Commit d9b41d29 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

screensaver: wait for process

This runs with a timer of its own. It's best to wait for the process
that do a fork bomb, if it ever takes a long.
parent e1e7582a
...@@ -136,8 +136,8 @@ static void Execute (vlc_inhibit_t *p_ih, const char *const *argv) ...@@ -136,8 +136,8 @@ static void Execute (vlc_inhibit_t *p_ih, const char *const *argv)
vlc_inhibit_sys_t *p_sys = p_ih->p_sys; vlc_inhibit_sys_t *p_sys = p_ih->p_sys;
pid_t pid; pid_t pid;
if (posix_spawn (&pid, argv[0], &p_sys->actions, &p_sys->attr, if (posix_spawnp (&pid, argv[0], &p_sys->actions, &p_sys->attr,
(char **)argv, environ) == 0) (char **)argv, environ) == 0)
{ {
while (waitpid (pid, NULL, 0) != pid); while (waitpid (pid, NULL, 0) != pid);
} }
...@@ -155,11 +155,11 @@ static void Timer( void *data ) ...@@ -155,11 +155,11 @@ static void Timer( void *data )
/* If there is a playing video output, disable xscreensaver */ /* If there is a playing video output, disable xscreensaver */
/* http://www.jwz.org/xscreensaver/faq.html#dvd */ /* http://www.jwz.org/xscreensaver/faq.html#dvd */
const char *const ppsz_xsargs[] = { "/bin/sh", "-c", const char *const ppsz_xsargs[] = {
"xscreensaver-command -deactivate &", (char*)NULL }; "xscreensaver-command", "-deactivate", (char*)NULL };
Execute (p_ih, ppsz_xsargs); Execute (p_ih, ppsz_xsargs);
const char *const ppsz_gsargs[] = { "/bin/sh", "-c", const char *const ppsz_gsargs[] = {
"gnome-screensaver-command --poke &", (char*)NULL }; "gnome-screensaver-command", "--poke", (char*)NULL };
Execute (p_ih, ppsz_gsargs); Execute (p_ih, ppsz_gsargs);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment