freebsd-ports/sysutils/polkit/files/patch-src_polkitd_gposixsignal.c
Koop Mast 3680f27ebf Presenting GNOME 2.32.1 for FreeBSD. The offical release notes for this
release can be found at http://library.gnome.org/misc/release-notes/2.32/

This will be the last release of the GNOME 2.x series, mainly a bugfix and
bridge release to the first release of the GNOME 3.x series.

This release features commits by avl, marcus, mezz and myself.

The FreeBSD GNOME Team would like to thank the following contributors and
testers for there help with this release:

Zane C.B. <vvelox@vvelox.net>
romain@
Olaf Seibert <O.Seibert@cs.ru.nl>
DomiX
Bapt <baptiste.daroussin@gmail.com>
jsa@
miwi@
Sergio de Almeida Lenzi <lenzi.sergio@gmail.com>
Maxim Samsonov <xors@mne.ru>
Kris Moore

And pav@ for 2 exp-runs

PR:		ports/152255
		ports/143260
		ports/141033
		ports/149629
		ports/150350
		ports/151523
With hat:	gnome@
2010-11-20 15:37:08 +00:00

40 lines
1.1 KiB
C

--- src/polkitd/gposixsignal.c.orig 2010-08-29 20:05:07.000000000 -0400
+++ src/polkitd/gposixsignal.c 2010-08-29 20:13:20.000000000 -0400
@@ -23,7 +23,13 @@
#include "config.h"
#include <unistd.h>
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <sys/event.h>
+#include <sys/time.h>
+#else
#include <sys/signalfd.h>
+#endif
#include <signal.h>
#include "gposixsignal.h"
@@ -83,6 +89,9 @@ _g_posix_signal_source_new (gint signum)
gint fd;
GSource *_source;
_GPosixSignalSource *source;
+#ifdef __FreeBSD__
+ struct kevent ev;
+#endif
_source = NULL;
@@ -92,7 +101,13 @@ _g_posix_signal_source_new (gint signum)
if (sigprocmask (SIG_BLOCK, &sigset, NULL) == -1)
g_assert_not_reached ();
+#ifdef __FreeBSD__
+ fd = kqueue ();
+ EV_SET (&ev, signum, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL);
+ kevent (fd, &ev, 1, NULL, 0, NULL);
+#else
fd = signalfd (-1, &sigset, SFD_NONBLOCK | SFD_CLOEXEC);
+#endif
_source = g_source_new (&_g_posix_signal_source_funcs, sizeof (_GPosixSignalSource));
source = (_GPosixSignalSource *) _source;