diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2006-05-02 17:04:09 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2006-05-02 17:04:09 +0000 |
commit | 12eacf0e3d21f6b2268b054f0a87edb588935b53 (patch) | |
tree | 7a501554538bfe19b5ab6cd1beb13ce3b937ca16 /devel/dbus | |
parent | Fix build for systems with missing hostname. (diff) |
Add a half-second delay before HUP'ing the system daemon when the system.d
contents change. This avoids a race with install(1) that causes dbus
to die. Also, adjust the list of kevent notes to be closer to what dnotify
is using in Linux.
Notes
Notes:
svn path=/head/; revision=161205
Diffstat (limited to 'devel/dbus')
-rw-r--r-- | devel/dbus/Makefile | 2 | ||||
-rw-r--r-- | devel/dbus/files/patch-bus_dir-watch.c | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/devel/dbus/Makefile b/devel/dbus/Makefile index 7903165e0264..4d8b9cabdd3c 100644 --- a/devel/dbus/Makefile +++ b/devel/dbus/Makefile @@ -7,7 +7,7 @@ PORTNAME= dbus PORTVERSION= 0.61 -PORTREVISION?= 1 +PORTREVISION?= 2 CATEGORIES?= devel gnome MASTER_SITES= http://dbus.freedesktop.org/releases/ diff --git a/devel/dbus/files/patch-bus_dir-watch.c b/devel/dbus/files/patch-bus_dir-watch.c index 2eb1dfa1a882..c848f1fd9746 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 Sun Jul 3 02:07:14 2005 ++++ bus/dir-watch.c Tue May 2 12:52:08 2006 @@ -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,144 @@ bus_drop_all_directory_watches (void) +@@ -92,6 +100,147 @@ bus_drop_all_directory_watches (void) } } @@ -59,6 +59,10 @@ + + res = kevent (kq, NULL, 0, &ev, 1, &nullts); + ++ /* Sleep for half a second to avoid a race when files are install(1)'d ++ * to system.d. */ ++ usleep(500000); ++ + if (res > 0) + { + pid = getpid (); @@ -139,8 +143,7 @@ + } + + EV_SET (&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, -+ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_LINK | NOTE_RENAME | -+ NOTE_REVOKE, 0, 0); ++ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME, 0, 0); + if (kevent (kq, &ev, 1, NULL, 0, NULL) == -1) + { + _dbus_warn ("Cannot setup a kevent for '%s'; error '%s'\n", dir, _dbus_strerror (errno)); |