]> git.sesse.net Git - vlc/commitdiff
screensaver: wait for process
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 14 Feb 2010 16:00:53 +0000 (18:00 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 14 Feb 2010 16:02:07 +0000 (18:02 +0200)
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.

modules/misc/screensaver.c

index 8c59f83328385a0092fd64a14ff9f7b19a62ddbb..98740a29492642d2f1a789b52106425b1fddcf83 100644 (file)
@@ -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;
     pid_t pid;
 
-    if (posix_spawn (&pid, argv[0], &p_sys->actions, &p_sys->attr,
-                     (char **)argv, environ) == 0)
+    if (posix_spawnp (&pid, argv[0], &p_sys->actions, &p_sys->attr,
+                      (char **)argv, environ) == 0)
     {
         while (waitpid (pid, NULL, 0) != pid);
     }
@@ -155,11 +155,11 @@ static void Timer( void *data )
 
     /* If there is a playing video output, disable xscreensaver */
     /* http://www.jwz.org/xscreensaver/faq.html#dvd */
-    const char *const ppsz_xsargs[] = { "/bin/sh", "-c",
-        "xscreensaver-command -deactivate &", (char*)NULL };
+    const char *const ppsz_xsargs[] = {
+        "xscreensaver-command", "-deactivate", (char*)NULL };
     Execute (p_ih, ppsz_xsargs);
 
-    const char *const ppsz_gsargs[] = { "/bin/sh", "-c",
-        "gnome-screensaver-command --poke &", (char*)NULL };
+    const char *const ppsz_gsargs[] = {
+        "gnome-screensaver-command", "--poke", (char*)NULL };
     Execute (p_ih, ppsz_gsargs);
 }