]> Dogcows Code - chaz/openbox/commitdiff
can restart now
authorDana Jansens <danakj@orodu.net>
Thu, 20 Mar 2003 01:53:38 +0000 (01:53 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 20 Mar 2003 01:53:38 +0000 (01:53 +0000)
openbox/openbox.c

index 025a16a7612341faff9781d7119c938ad0bb68c8..886285c72cffd639d6db7c9b8f1d2325e8d07470 100644 (file)
@@ -35,6 +35,9 @@
 #ifdef HAVE_LOCALE_H
 #  include <locale.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
 
 #include <X11/cursorfont.h>
 
@@ -174,9 +177,20 @@ int main(int argc, char **argv)
 
     if (ob_restart) {
         if (ob_restart_path != NULL) {
+            int argcp;
+            char **argvp;
+            GError *err;
+
             /* run other shit */
+            if (g_shell_parse_argv(ob_restart_path, &argcp, &argvp, &err))
+                execvp(argvp[0], argvp);
+
+            g_strfreev(argvp);
         }
+
         /* re-run me */
+        execvp(argv[0], argv); /* try how we were run */
+        execlp("ob3", "ob3", NULL); /* try this as a last resort */
     }
      
     return 0;
This page took 0.026529 seconds and 4 git commands to generate.