diff options
Diffstat (limited to 'bus/dir-watch-kqueue.c')
-rw-r--r-- | bus/dir-watch-kqueue.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/bus/dir-watch-kqueue.c b/bus/dir-watch-kqueue.c index 4e436eb1..ac6290cc 100644 --- a/bus/dir-watch-kqueue.c +++ b/bus/dir-watch-kqueue.c @@ -50,12 +50,6 @@ static DBusWatch *watch = NULL; static DBusLoop *loop = NULL; static dbus_bool_t -_kqueue_watch_callback (DBusWatch *watch, unsigned int condition, void *data) -{ - return dbus_watch_handle (watch, condition); -} - -static dbus_bool_t _handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data) { struct kevent ev; @@ -80,7 +74,8 @@ _handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data) kq = -1; if (watch != NULL) { - _dbus_loop_remove_watch (loop, watch, _kqueue_watch_callback, NULL); + _dbus_loop_remove_watch (loop, watch); + _dbus_watch_invalidate (watch); _dbus_watch_unref (watch); watch = NULL; } @@ -120,14 +115,14 @@ _init_kqueue (BusContext *context) goto out; } - if (!_dbus_loop_add_watch (loop, watch, _kqueue_watch_callback, - NULL, NULL)) + if (!_dbus_loop_add_watch (loop, watch)) { _dbus_warn ("Unable to add reload watch to main loop"); - close (kq); - kq = -1; + _dbus_watch_invalidate (watch); _dbus_watch_unref (watch); watch = NULL; + close (kq); + kq = -1; goto out; } } |