--- 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 #include #include -#include +#if !defined(_POSIX_SPAWN) +# define _POSIX_SPAWN -1 +#else +# include +#endif #include static int Open (vlc_object_t *); @@ -46,7 +50,9 @@ struct vlc_inhibit_sys { vlc_timer_t timer; +#if (_POSIX_SPAWN >= 0) posix_spawnattr_t attr; +#endif }; extern char **environ; @@ -91,6 +97,7 @@ if (p_sys == NULL) return VLC_ENOMEM; +#if (_POSIX_SPAWN >= 0) 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 } ih->p_sys = p_sys; if (vlc_timer_create (&p_sys->timer, Timer, ih)) { +#if (_POSIX_SPAWN >= 0) posix_spawnattr_destroy (&p_sys->attr); +#endif free (p_sys); return VLC_ENOMEM; } @@ -122,6 +132,8 @@ vlc_inhibit_sys_t *p_sys = ih->p_sys; vlc_timer_destroy (p_sys->timer); +#if (_POSIX_SPAWN >= 0) posix_spawnattr_destroy (&p_sys->attr); +#endif free (p_sys); }