aboutsummaryrefslogtreecommitdiffstats
path: root/main/vlc/uclibc-inhibit-spawn.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/vlc/uclibc-inhibit-spawn.patch')
-rw-r--r--main/vlc/uclibc-inhibit-spawn.patch76
1 files changed, 29 insertions, 47 deletions
diff --git a/main/vlc/uclibc-inhibit-spawn.patch b/main/vlc/uclibc-inhibit-spawn.patch
index c34ebe0f7b..03254270ff 100644
--- a/main/vlc/uclibc-inhibit-spawn.patch
+++ b/main/vlc/uclibc-inhibit-spawn.patch
@@ -1,10 +1,8 @@
-diff --git a/modules/misc/inhibit/xdg.c b/modules/misc/inhibit/xdg.c
-index 3f297c6..e16a21e 100644
---- a/modules/misc/inhibit/xdg.c
-+++ b/modules/misc/inhibit/xdg.c
-@@ -27,7 +27,11 @@
- #include <vlc_inhibit.h>
+--- a/modules/misc/inhibit/xdg.c 2013-06-24 20:00:38.000000000 +0200
++++ b/modules/misc/inhibit/xdg.c 2013-09-26 13:43:21.819782562 +0200
+@@ -28,7 +28,11 @@
#include <assert.h>
+ #include <errno.h>
#include <signal.h>
-#include <spawn.h>
+#if !defined(_POSIX_SPAWN)
@@ -15,62 +13,46 @@ index 3f297c6..e16a21e 100644
#include <sys/wait.h>
static int Open (vlc_object_t *);
-@@ -47,7 +51,9 @@ struct vlc_inhibit_sys
- vlc_thread_t thread;
- vlc_cond_t update, inactive;
- vlc_mutex_t lock;
+@@ -46,7 +50,9 @@
+ struct vlc_inhibit_sys
+ {
+ vlc_timer_t timer;
+#if (_POSIX_SPAWN >= 0)
posix_spawnattr_t attr;
+#endif
- bool suspend, suspended;
};
-@@ -67,17 +73,19 @@ static int Open (vlc_object_t *obj)
- vlc_mutex_init (&p_sys->lock);
- vlc_cond_init (&p_sys->update);
- vlc_cond_init (&p_sys->inactive);
-- posix_spawnattr_init (&p_sys->attr);
- /* Reset signal handlers to default and clear mask in the child process */
- {
- sigset_t set;
+ extern char **environ;
+@@ -91,6 +97,7 @@
+ if (p_sys == NULL)
+ return VLC_ENOMEM;
- sigemptyset (&set);
-- posix_spawnattr_setsigmask (&p_sys->attr, &set);
- sigaddset (&set, SIGPIPE);
+#if (_POSIX_SPAWN >= 0)
-+ posix_spawnattr_init (&p_sys->attr);
-+ posix_spawnattr_setsigmask (&p_sys->attr, &set);
+ posix_spawnattr_init (&p_sys->attr);
+ /* Reset signal handlers to default and clear mask in the child process */
+ {
+@@ -102,12 +109,15 @@
posix_spawnattr_setsigdefault (&p_sys->attr, &set);
posix_spawnattr_setflags (&p_sys->attr, POSIX_SPAWN_SETSIGDEF
| POSIX_SPAWN_SETSIGMASK);
+#endif
}
- p_sys->suspend = false;
- p_sys->suspended = false;
-@@ -106,7 +114,9 @@ static void Close (vlc_object_t *obj)
- vlc_cancel (p_sys->thread);
- vlc_join (p_sys->thread, NULL);
+ ih->p_sys = p_sys;
+ if (vlc_timer_create (&p_sys->timer, Timer, ih))
+ {
+#if (_POSIX_SPAWN >= 0)
- posix_spawnattr_destroy (&p_sys->attr);
+ posix_spawnattr_destroy (&p_sys->attr);
+#endif
- vlc_cond_destroy (&p_sys->inactive);
- vlc_cond_destroy (&p_sys->update);
- vlc_mutex_destroy (&p_sys->lock);
-@@ -153,8 +163,16 @@ static void *Thread (void *data)
- pid_t pid;
+ free (p_sys);
+ return VLC_ENOMEM;
+ }
+@@ -122,6 +132,8 @@
+ vlc_inhibit_sys_t *p_sys = ih->p_sys;
- vlc_mutex_unlock (&p_sys->lock);
+ vlc_timer_destroy (p_sys->timer);
+#if (_POSIX_SPAWN >= 0)
- if (!posix_spawnp (&pid, "xdg-screensaver", NULL, &p_sys->attr,
- argv, environ))
-+#else
-+ pid = fork();
-+ if (pid == 0) {
-+ execvp("xdg-screensaver", argv);
-+ exit(1);
-+ } else if (pid > 0)
+ posix_spawnattr_destroy (&p_sys->attr);
+#endif
- {
- int status;
-
+ free (p_sys);
+ }