diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2006-10-14 08:35:50 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2006-10-14 08:35:50 +0000 |
commit | f1bb12de8e50bf76ae21f37debda60994ec7fd99 (patch) | |
tree | 1671d4beef381f12d939e34b344eb385a3af4f19 /devel/dbus/files/patch-bus_dir-watch.c | |
parent | - Mark BROKEN on 6.x and below: this port uses posix_memalign(3) (diff) |
Presenting GNOME 2.16.1 for FreeBSD. This release represents a massive
amount of work by the FreeBSD GNOME Team and our testers.
On top of the usual GNOME update, we have taken this opportunity to move
GNOME from X11BASE to LOCALBASE. This means roughly 600 ports NOT part of
the GNOME Desktop also need to be changed. The bulk of the move was carried
out by ahze, mezz, and pav, but it would not have been possible without
cooperation from the FreeBSD KDE team who worked with us to make sure
GNOME and KDE can still coexist happily. We would also like to send a
shout out to kris and pointyhat for putting up with multiple test runs
until we got something that was solid.
Back to GNOME 2.16. This release brings a huge amount of new functionality
to FreeBSD. The standard release notes can be read at
http://www.gnome.org/start/2.16/ . But on top of what you will read there,
jylefort and marcus have completed work on a port of HAL to FreeBSD. This
will allow FreeBSD to take advantage of closer hardware interaction such
as auto-mounting CD-ROMs, USB drives, and music players; auto-playing
audio CDs; and managing laptop power consumption.
But where would this all be without our loyal testers and contributors?
Therefore, the FreeBSD GNOME team would like to thank the following users:
Phillip Neumann <pneumann@gmail.com>
tmclaugh
mux
Yuri Pankov <yuri.pankov@gmail.com>
chinsan
Thomas <freebsdlists@bsdunix.ch>
Brian Gruber <knightbg@yahoo.com>
Franz Klammer <klammer@webonaut.com>
Dominique Goncalves <dominique.goncalves@gmail.com>
Pascal Hofstee <caelian@gmail.com>
Yasuda Keisuke <kysd@po.harenet.ne.jp>
backyard <backyard1454-bsd@yahoo.com>
Andris Raugulis <endrju@null.lv> <endrju@null.lv>
Eric L. Chen <d9364104@mail.nchu.edu.tw>
Pawel Worach <pawel.worach@gmail.com>
QuiRK on #freebsd-gnome
Shane Bell <decept0@gmail.com>
luigi
sajd on #freebsd-gnome
sat
Chris Coleman <chrisc@vmunix.com>
kaeru on #freebsd-gnome
crsd_ via irc.freenode.org/#FreeBSD-GNOME
Joel Diaz <joeldiaz@mac.com>
Enjoy!
Approved by: portmgr (implicit, kris)
Diffstat (limited to 'devel/dbus/files/patch-bus_dir-watch.c')
-rw-r--r-- | devel/dbus/files/patch-bus_dir-watch.c | 178 |
1 files changed, 0 insertions, 178 deletions
diff --git a/devel/dbus/files/patch-bus_dir-watch.c b/devel/dbus/files/patch-bus_dir-watch.c deleted file mode 100644 index c848f1fd9746..000000000000 --- a/devel/dbus/files/patch-bus_dir-watch.c +++ /dev/null @@ -1,178 +0,0 @@ ---- bus/dir-watch.c.orig Tue Jun 14 22:31:38 2005 -+++ bus/dir-watch.c Tue May 2 12:52:08 2006 -@@ -28,17 +28,25 @@ - #include <stdlib.h> - #include <unistd.h> - #include <fcntl.h> -+#elif defined(DBUS_BUS_ENABLE_KQUEUE_ON_FREEBSD) -+#include <sys/types.h> -+#include <sys/event.h> -+#include <sys/time.h> -+#include <signal.h> -+#include <fcntl.h> -+#include <unistd.h> -+#include "bus.h" -+#include <dbus/dbus-watch.h> - #endif /* DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX */ - - #include <dbus/dbus-internals.h> - #include "dir-watch.h" - -+#define MAX_DIRS_TO_WATCH 128 - - /* D_NOTIFY is available on Linux 2.4 or greater - the actual SIGIO signal is handled in main.c:signal_handler() */ - #ifdef DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX - --#define MAX_DIRS_TO_WATCH 128 -- - /* use a static array to avoid handling OOM */ - static int fds[MAX_DIRS_TO_WATCH]; - static int num_fds = 0; -@@ -92,6 +100,147 @@ bus_drop_all_directory_watches (void) - } - } - -+ num_fds = 0; -+} -+ -+#elif defined(DBUS_BUS_ENABLE_KQUEUE_ON_FREEBSD) -+ -+static int kq = -1; -+static int fds[MAX_DIRS_TO_WATCH]; -+static int num_fds = 0; -+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; -+ struct timespec nullts = { 0, 0 }; -+ int res; -+ pid_t pid; -+ -+ 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 (); -+ _dbus_verbose ("Sending SIGHUP signal on reception of a kevent\n"); -+ (void) kill (pid, SIGHUP); -+ } -+ else if (res < 0 && errno == EBADF) -+ { -+ kq = -1; -+ if (watch != NULL) -+ { -+ _dbus_loop_remove_watch (loop, watch, _kqueue_watch_callback, NULL); -+ _dbus_watch_unref (watch); -+ watch = NULL; -+ } -+ pid = getpid (); -+ _dbus_verbose ("Sending SIGHUP signal since kqueue has been closed\n"); -+ (void) kill (pid, SIGHUP); -+ } -+ -+ return TRUE; -+} -+ -+void -+bus_watch_directory (const char *dir, void *userdata) -+{ -+ int fd; -+ struct kevent ev; -+ -+ _dbus_assert (dir != NULL); -+ -+ if (kq < 0) -+ { -+ -+ kq = kqueue (); -+ if (kq < 0) -+ { -+ _dbus_warn ("Cannot create kqueue; error '%s'\n", _dbus_strerror (errno)); -+ goto out; -+ } -+ -+ loop = userdata; -+ -+ watch = _dbus_watch_new (kq, DBUS_WATCH_READABLE, TRUE, -+ _handle_kqueue_watch, NULL, NULL); -+ -+ if (watch == NULL) -+ { -+ _dbus_warn ("Unable to create kqueue watch\n"); -+ close (kq); -+ kq = -1; -+ goto out; -+ } -+ -+ if (!_dbus_loop_add_watch (loop, watch, _kqueue_watch_callback, -+ NULL, NULL)) -+ { -+ _dbus_warn ("Unable to add reload watch to main loop"); -+ close (kq); -+ kq = -1; -+ _dbus_watch_unref (watch); -+ watch = NULL; -+ goto out; -+ } -+ } -+ -+ if (num_fds >= MAX_DIRS_TO_WATCH ) -+ { -+ _dbus_warn ("Cannot watch config directory '%s'. Already watching %d directories\n", dir, MAX_DIRS_TO_WATCH); -+ goto out; -+ } -+ -+ fd = open (dir, O_RDONLY); -+ if (fd < 0) -+ { -+ _dbus_warn ("Cannot open directory '%s'; error '%s'\n", dir, _dbus_strerror (errno)); -+ goto out; -+ } -+ -+ EV_SET (&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, -+ 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)); -+ close (fd); -+ goto out; -+ } -+ -+ fds[num_fds++] = fd; -+ _dbus_verbose ("Added kqueue watch on config directory '%s'\n", dir); -+ -+ out: -+ ; -+} -+ -+void -+bus_drop_all_directory_watches (void) -+{ -+ int i; -+ -+ _dbus_verbose ("Dropping all watches on config directories\n"); -+ -+ for (i = 0; i < num_fds; i++) -+ { -+ if (close (fds[i]) != 0) -+ { -+ _dbus_verbose ("Error closing fd %d for config directory watch\n", fds[i]); -+ } -+ } -+ - num_fds = 0; - } - |