$NetBSD: patch-ar,v 1.1 2011/01/24 18:54:04 drochner Exp $

--- modules/misc/inhibit/xdg.c.orig	2010-11-26 22:32:46.000000000 +0000
+++ modules/misc/inhibit/xdg.c
@@ -26,7 +26,11 @@
 #include <vlc_plugin.h>
 #include <vlc_inhibit.h>
 #include <assert.h>
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
 #include <spawn.h>
+# endif
+#endif
 #include <sys/wait.h>
 
 static int Open (vlc_object_t *);
@@ -137,6 +141,8 @@ static void *Thread (void *data)
         pid_t pid;
 
         vlc_mutex_unlock (&p_sys->lock);
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
         if (!posix_spawnp (&pid, "xdg-screensaver", NULL, NULL, argv, environ))
         {
             int status;
@@ -146,6 +152,8 @@ static void *Thread (void *data)
             while (waitpid (pid, &status, 0) == -1);
         }
         else/* We don't handle the error, but busy looping would be worse :( */
+# endif
+#endif
             msg_Warn (ih, "could not start xdg-screensaver");
 
         vlc_mutex_lock (&p_sys->lock);
