pkgsrc/multimedia/vlc20/patches/patch-ar
wiz 731702fa11 Re-Import vlc-2.0.9nb21 (from vlc2) as multimedia/vlc20.
To better clarify which version this packages.

VideoLAN is a project of French students from the Ecole Centrale Paris
and developers from all over the world. Its main goals is MPEG streaming
on a network, but it also features a standalone multimedia player. The
VideoLAN Server can stream video read from a hard disk, a DVD player,
a satellite card or an MPEG 2 compression card, and unicast or multicast
it on a network. The VideoLAN Client can read the stream from the network
and display it. It can also be used to display video read locally on
the computer : DVDs, VCDs, MPEG and DivX files and from a satellite
card. It is multi-plaform : Linux, Windows, Mac OS X, BeOS, BSD, Solaris,
QNX, iPaq... The VideoLAN Client and Server now have a full IPv6 support.

This version is the last version with support for OSSv3, which is the
OSS version implemented in NetBSD before NetBSD 7.
2015-10-25 10:52:24 +00:00

88 lines
2.5 KiB
Text

$NetBSD: patch-ar,v 1.1 2015/10/25 10:52:24 wiz Exp $
--- modules/misc/inhibit/xdg.c.orig 2011-11-22 20:30:36.000000000 +0000
+++ modules/misc/inhibit/xdg.c
@@ -27,7 +27,11 @@
#include <vlc_inhibit.h>
#include <assert.h>
#include <signal.h>
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
#include <spawn.h>
+# endif
+#endif
#include <sys/wait.h>
static int Open (vlc_object_t *);
@@ -47,7 +51,11 @@ struct vlc_inhibit_sys
vlc_thread_t thread;
vlc_cond_t update, inactive;
vlc_mutex_t lock;
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
posix_spawnattr_t attr;
+# endif
+#endif
bool suspend, suspended;
};
@@ -67,17 +75,29 @@ 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);
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
posix_spawnattr_init (&p_sys->attr);
+# endif
+#endif
/* Reset signal handlers to default and clear mask in the child process */
{
sigset_t set;
sigemptyset (&set);
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
posix_spawnattr_setsigmask (&p_sys->attr, &set);
+# endif
+#endif
sigaddset (&set, SIGPIPE);
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
posix_spawnattr_setsigdefault (&p_sys->attr, &set);
posix_spawnattr_setflags (&p_sys->attr, POSIX_SPAWN_SETSIGDEF
| POSIX_SPAWN_SETSIGMASK);
+# endif
+#endif
}
p_sys->suspend = false;
p_sys->suspended = false;
@@ -106,7 +126,11 @@ static void Close (vlc_object_t *obj)
vlc_cancel (p_sys->thread);
vlc_join (p_sys->thread, NULL);
+#ifdef _POSIX_SPAWN
+# if (_POSIX_SPAWN >= 0)
posix_spawnattr_destroy (&p_sys->attr);
+# endif
+#endif
vlc_cond_destroy (&p_sys->inactive);
vlc_cond_destroy (&p_sys->update);
vlc_mutex_destroy (&p_sys->lock);
@@ -152,6 +176,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, &p_sys->attr,
argv, environ))
{
@@ -162,6 +188,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);