[vlc-devel] commit: screensaver: wait for process ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Feb 14 17:02:09 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 14 18:00:53 2010 +0200| [d9b41d296958a27fe2993889e4acf9a4915d2821] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d9b41d296958a27fe2993889e4acf9a4915d2821
---

 modules/misc/screensaver.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/misc/screensaver.c b/modules/misc/screensaver.c
index 8c59f83..98740a2 100644
--- a/modules/misc/screensaver.c
+++ b/modules/misc/screensaver.c
@@ -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);
 }




More information about the vlc-devel mailing list