diff options
Diffstat (limited to 'main/vlc/uclibc-inhibit-spawn.patch')
-rw-r--r-- | main/vlc/uclibc-inhibit-spawn.patch | 73 |
1 files changed, 68 insertions, 5 deletions
diff --git a/main/vlc/uclibc-inhibit-spawn.patch b/main/vlc/uclibc-inhibit-spawn.patch index 03254270ff..9c7e72ed66 100644 --- a/main/vlc/uclibc-inhibit-spawn.patch +++ b/main/vlc/uclibc-inhibit-spawn.patch @@ -1,5 +1,6 @@ +diff -rupN a/modules/misc/inhibit/xdg.c b/modules/misc/inhibit/xdg.c --- 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 ++++ b/modules/misc/inhibit/xdg.c 2013-09-26 13:57:19.839770148 +0200 @@ -28,7 +28,11 @@ #include <assert.h> #include <errno.h> @@ -13,7 +14,7 @@ #include <sys/wait.h> static int Open (vlc_object_t *); -@@ -46,7 +50,9 @@ +@@ -46,7 +50,9 @@ vlc_module_end () struct vlc_inhibit_sys { vlc_timer_t timer; @@ -23,7 +24,7 @@ }; extern char **environ; -@@ -91,6 +97,7 @@ +@@ -91,6 +97,7 @@ static int Open (vlc_object_t *obj) if (p_sys == NULL) return VLC_ENOMEM; @@ -31,7 +32,7 @@ posix_spawnattr_init (&p_sys->attr); /* Reset signal handlers to default and clear mask in the child process */ { -@@ -102,12 +109,15 @@ +@@ -102,12 +109,15 @@ static int Open (vlc_object_t *obj) posix_spawnattr_setsigdefault (&p_sys->attr, &set); posix_spawnattr_setflags (&p_sys->attr, POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK); @@ -47,7 +48,7 @@ free (p_sys); return VLC_ENOMEM; } -@@ -122,6 +132,8 @@ +@@ -122,6 +132,8 @@ static void Close (vlc_object_t *obj) vlc_inhibit_sys_t *p_sys = ih->p_sys; vlc_timer_destroy (p_sys->timer); @@ -56,3 +57,65 @@ +#endif free (p_sys); } +diff -rupN a/src/posix/netconf.c b/src/posix/netconf.c +--- a/src/posix/netconf.c 2013-06-24 20:00:39.000000000 +0200 ++++ b/src/posix/netconf.c 2013-09-26 13:56:46.149770648 +0200 +@@ -29,7 +29,11 @@ + #include <sys/types.h> + #include <sys/wait.h> + #include <fcntl.h> ++#if !defined(_POSIX_SPAWN) ++# define _POSIX_SPAWN -1 ++#else + #include <spawn.h> ++#endif + #include <unistd.h> + + extern char **environ; +@@ -47,36 +51,45 @@ char *vlc_getProxyUrl(const char *url) + { + /* libproxy helper */ + pid_t pid; ++#if (_POSIX_SPAWN >= 0) + posix_spawn_file_actions_t actions; + posix_spawnattr_t attr; ++#endif + char *argv[3] = { (char *)"proxy", (char *)url, NULL }; + int fd[2]; + + if (vlc_pipe(fd)) + return NULL; + ++#if (_POSIX_SPAWN >= 0) + posix_spawn_file_actions_init(&actions); + posix_spawn_file_actions_addopen(&actions, STDIN_FILENO, "/dev/null", + O_RDONLY, 0644); + posix_spawn_file_actions_adddup2(&actions, fd[1], STDOUT_FILENO); + + posix_spawnattr_init(&attr); ++#endif + { + sigset_t set; + + sigemptyset(&set); ++#if (_POSIX_SPAWN >= 0) + posix_spawnattr_setsigmask(&attr, &set); ++#endif + sigaddset (&set, SIGPIPE); ++#if (_POSIX_SPAWN >= 0) + posix_spawnattr_setsigdefault(&attr, &set); + posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGDEF + | POSIX_SPAWN_SETSIGMASK); ++#endif + } +- ++#if (_POSIX_SPAWN >= 0) + if (posix_spawnp(&pid, "proxy", &actions, &attr, argv, environ)) + pid = -1; + + posix_spawnattr_destroy(&attr); + posix_spawn_file_actions_destroy(&actions); ++#endif + close(fd[1]); + + if (pid != -1) |