summaryrefslogtreecommitdiffstats
path: root/main/vlc/uclibc-inhibit-spawn.patch
blob: 9a6be5bd6acd535033f39e0d8a5f87a4e80dafe1 (plain)
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
diff --git a/modules/misc/inhibit/xdg.c b/modules/misc/inhibit/xdg.c
index 01decac..134c5c9 100644
--- a/modules/misc/inhibit/xdg.c
+++ b/modules/misc/inhibit/xdg.c
@@ -25,7 +25,12 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_inhibit.h>
-#include <spawn.h>
+#if !defined(_POSIX_SPAWN)
+# define _POSIX_SPAWN -1
+#else
+# include <spawn.h>
+#endif
+
 #include <sys/wait.h>
 
 static int Open (vlc_object_t *);
@@ -125,8 +130,15 @@ static void *Thread (void *data)
         };
         pid_t pid;
         int canc = vlc_savecancel ();
-
+#if (_POSIX_SPAWN >= 0)
         if (!posix_spawnp (&pid, "xdg-screensaver", NULL, NULL, argv, environ))
+#else
+	pid = fork();
+	if (pid == 0) {
+		execvp("xdg-screensaver", argv);
+		exit(1);
+	} else if (pid > 0)
+#endif
         {
             int status;