blob: 1fe27fbab27efbe7432149423a63bbe12f87d5a9 (
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
|
--- a/modules/misc/inhibit/xdg.c.orig
+++ b/modules/misc/inhibit/xdg.c
@@ -26,7 +26,12 @@
#include <vlc_plugin.h>
#include <vlc_inhibit.h>
#include <assert.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 *);
@@ -137,7 +142,15 @@
pid_t pid;
vlc_mutex_unlock (&p_sys->lock);
+#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;
|