1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
$NetBSD: patch-an,v 1.2 2009/01/20 10:08:17 sketch Exp $
--- src/polkit/polkit-context.c.orig Fri May 30 22:24:44 2008
+++ src/polkit/polkit-context.c Tue Jan 20 09:45:55 2009
@@ -39,7 +39,7 @@
#include <grp.h>
#include <unistd.h>
#include <errno.h>
-#ifdef HAVE_SOLARIS
+#ifdef HAVE_OPENSOLARIS
#include <port.h>
#include <sys/stat.h>
#else
@@ -176,7 +176,7 @@
/* NOTE: we don't load the configuration file until it's needed */
-#ifdef HAVE_SOLARIS
+#ifdef HAVE_OPENSOLARIS
if (pk_context->io_add_watch_func != NULL) {
pk_context->inotify_fd = port_create ();
if (pk_context->inotify_fd < 0) {
@@ -310,6 +310,7 @@
}
#else
if (pk_context->io_add_watch_func != NULL) {
+#ifdef HAVE_INOTIFY
pk_context->inotify_fd = inotify_init ();
if (pk_context->inotify_fd < 0) {
polkit_debug ("failed to initialize inotify: %s", strerror (errno));
@@ -358,6 +359,7 @@
/* TODO: set error */
goto error;
}
+#endif
}
#endif
@@ -366,7 +368,7 @@
return FALSE;
}
-#ifdef HAVE_SOLARIS
+#ifdef HAVE_OPENSOLARIS
struct fileportinfo {
struct file_obj fobj;
@@ -518,7 +520,7 @@
config_changed = FALSE;
-#ifdef HAVE_SOLARIS
+#ifdef HAVE_OPENSOLARIS
if (fd == pk_context->inotify_fd) {
port_event_t pe;
struct file_obj *fobjp;
@@ -571,7 +573,7 @@
polkit_debug ("failed to read kqueue event: %s", strerror (errno));
}
}
-#else
+#elif HAVE_INOTIFY
if (fd == pk_context->inotify_fd) {
/* size of the event structure, not counting name */
#define EVENT_SIZE (sizeof (struct inotify_event))
|