summaryrefslogtreecommitdiffstats
path: root/devel/dbus/files/patch-bus_dir-watch.c
diff options
context:
space:
mode:
Diffstat (limited to 'devel/dbus/files/patch-bus_dir-watch.c')
-rw-r--r--devel/dbus/files/patch-bus_dir-watch.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/devel/dbus/files/patch-bus_dir-watch.c b/devel/dbus/files/patch-bus_dir-watch.c
index 497f5ad..68af867 100644
--- a/devel/dbus/files/patch-bus_dir-watch.c
+++ b/devel/dbus/files/patch-bus_dir-watch.c
@@ -1,5 +1,5 @@
--- bus/dir-watch.c.orig Tue Jun 14 22:31:38 2005
-+++ bus/dir-watch.c Fri Jul 1 01:07:28 2005
++++ bus/dir-watch.c Sat Jul 2 15:07:55 2005
@@ -28,17 +28,25 @@
#include <stdlib.h>
#include <unistd.h>
@@ -28,7 +28,7 @@
/* use a static array to avoid handling OOM */
static int fds[MAX_DIRS_TO_WATCH];
static int num_fds = 0;
-@@ -92,6 +100,121 @@ bus_drop_all_directory_watches (void)
+@@ -92,6 +100,132 @@ bus_drop_all_directory_watches (void)
}
}
@@ -45,13 +45,24 @@
+_handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
+{
+ struct kevent ev;
++ int res;
++ pid_t pid;
+
-+ if (kevent (kq, NULL, 0, &ev, 1, NULL) > 0)
++ res = kevent (kq, NULL, 0, &ev, 1, NULL);
++
++ if (res > 0)
+ {
-+ pid_t pid = getpid ();
++ pid = getpid ();
+ _dbus_verbose ("Sending SIGHUP signal on reception of a kevent\n");
+ (void) kill (pid, SIGHUP);
+ }
++ else if (res < 0 && errno == EBADF)
++ {
++ kq = -1;
++ pid = getpid ();
++ _dbus_verbose ("Sending SIGHUP signal since kqueue has been closed\n");
++ (void) kill (pid, SIGHUP);
++ }
+
+ return TRUE;
+}
OpenPOWER on IntegriCloud