diff options
author | 2010-01-26 02:54:34 +0100 | |
---|---|---|
committer | 2010-01-26 21:23:18 +0100 | |
commit | 7f7676e77beb43134b3e4d662d09b685d96c8d94 (patch) | |
tree | 6f57f6703721193e80a7f08115e8402068f05760 | |
parent | esx: Output error details from libcurl (diff) | |
download | libvirt-7f7676e77beb43134b3e4d662d09b685d96c8d94.tar.gz libvirt-7f7676e77beb43134b3e4d662d09b685d96c8d94.tar.bz2 libvirt-7f7676e77beb43134b3e4d662d09b685d96c8d94.zip |
Don't call disabled timer callbacks in event-test.c
This fixes a segfault in the remote driver that occurs for example when
the event-test is run inside a domain-0 and libvirtd is also running.
-rw-r--r-- | examples/domain-events/events-c/event-test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c index b50668750..b2eb1d526 100644 --- a/examples/domain-events/events-c/event-test.c +++ b/examples/domain-events/events-c/event-test.c @@ -335,9 +335,10 @@ int main(int argc, char **argv) sts = poll(&pfd, 1, TIMEOUT_MS); - /* We are assuming timeout of 0 here - so execute every time */ - if(t_cb && t_active) + /* if t_timeout < 0 then t_cb must not be called */ + if (t_cb && t_active && t_timeout >= 0) { t_cb(t_timeout,t_opaque); + } if (sts == 0) { /* DEBUG0("Poll timeout"); */ |