aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/qemu/event_notifier.h1
-rw-r--r--util/event_notifier-posix.c5
-rw-r--r--util/event_notifier-win32.c2
3 files changed, 1 insertions, 7 deletions
diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h
index b30a45474f..599c99f1a5 100644
--- a/include/qemu/event_notifier.h
+++ b/include/qemu/event_notifier.h
@@ -26,7 +26,6 @@ struct EventNotifier {
int rfd;
int wfd;
#endif
- void (*cleanup)(EventNotifier *);
};
typedef void EventNotifierHandler(EventNotifier *);
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 652566634a..73c4046b58 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -29,7 +29,6 @@ void event_notifier_init_fd(EventNotifier *e, int fd)
{
e->rfd = fd;
e->wfd = fd;
- e->cleanup = NULL;
}
#endif
@@ -66,7 +65,6 @@ int event_notifier_init(EventNotifier *e, int active)
e->rfd = fds[0];
e->wfd = fds[1];
}
- e->cleanup = NULL;
if (active) {
event_notifier_set(e);
}
@@ -82,11 +80,10 @@ void event_notifier_cleanup(EventNotifier *e)
{
if (e->rfd != e->wfd) {
close(e->rfd);
+ e->rfd = -1;
}
close(e->wfd);
- e->rfd = -1;
e->wfd = -1;
- e->cleanup = NULL;
}
int event_notifier_get_fd(const EventNotifier *e)
diff --git a/util/event_notifier-win32.c b/util/event_notifier-win32.c
index eff86701ad..62c53b0a99 100644
--- a/util/event_notifier-win32.c
+++ b/util/event_notifier-win32.c
@@ -19,7 +19,6 @@ int event_notifier_init(EventNotifier *e, int active)
{
e->event = CreateEvent(NULL, TRUE, FALSE, NULL);
assert(e->event);
- e->cleanup = NULL;
return 0;
}
@@ -27,7 +26,6 @@ void event_notifier_cleanup(EventNotifier *e)
{
CloseHandle(e->event);
e->event = NULL;
- e->cleanup = NULL;
}
HANDLE event_notifier_get_handle(EventNotifier *e)