$NetBSD$

--- 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))
