aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/qemud
diff options
context:
space:
mode:
authorMori, Yoshio X <yoshio.x.mori@sonyericsson.com>2010-09-03 11:42:16 +0200
committerJohan Redestig <johan.redestig@sonyericsson.com>2010-09-07 17:33:16 +0200
commit6bc98d9a276ecae99c9276fdedb1dc3ca95e158f (patch)
treef9fed8357cf5f77629a80725249b3088ff950026 /emulator/qemud
parent26f116ed57a0b42b397d919c1e5e18fb704f1bce (diff)
downloadsdk-6bc98d9a276ecae99c9276fdedb1dc3ca95e158f.zip
sdk-6bc98d9a276ecae99c9276fdedb1dc3ca95e158f.tar.gz
sdk-6bc98d9a276ecae99c9276fdedb1dc3ca95e158f.tar.bz2
Fixed a problem that physical address is inconsistent.
When epoll_wait detected a state change of fd, an events structure including pointer appointed in epoll_ctl is returned by epoll_wait. The data of each returned structure will contain the same data the user set with a epoll_ctl(2) (EPOLL_CTL_ADD,EPOLL_CTL_MOD) while the events member will contain the returned event bit field. When older hook and epoll_event are deleted after hook and epoll_event are added newly, this problem occur. So, when hook is closed, rewrite physical address of epoll_event which is pointing hook. Change-Id: I90f01ba5fbf307b3483da67d993cb874ba56d155
Diffstat (limited to 'emulator/qemud')
-rw-r--r--emulator/qemud/qemud.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/emulator/qemud/qemud.c b/emulator/qemud/qemud.c
index 92b2a2b..e1c7b54 100644
--- a/emulator/qemud/qemud.c
+++ b/emulator/qemud/qemud.c
@@ -541,6 +541,7 @@ looper_loop( Looper* l )
/* now remove all the hooks that were closed by
* the callbacks */
for (n = 0; n < l->num_fds;) {
+ struct epoll_event ev;
LoopHook* hook = l->hooks + n;
if (!(hook->state & HOOK_CLOSING)) {
@@ -550,6 +551,9 @@ looper_loop( Looper* l )
hook[0] = l->hooks[l->num_fds-1];
l->num_fds -= 1;
+ ev.events = hook->wanted;
+ ev.data.ptr = hook;
+ epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, hook->fd, &ev );
}
}
}