From 8758271498db8de722b5a5af04427b21e834bef3 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 20 Mar 2003 07:48:59 +0000 Subject: [PATCH] restart and catch errors appropriately --- openbox/openbox.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openbox/openbox.c b/openbox/openbox.c index 886285c7..017eb184 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -176,16 +176,20 @@ int main(int argc, char **argv) XCloseDisplay(ob_display); if (ob_restart) { + ob_restart_path = ""; if (ob_restart_path != NULL) { int argcp; char **argvp; - GError *err; + GError *err = NULL; /* run other shit */ - if (g_shell_parse_argv(ob_restart_path, &argcp, &argvp, &err)) + if (g_shell_parse_argv(ob_restart_path, &argcp, &argvp, &err)) { execvp(argvp[0], argvp); - - g_strfreev(argvp); + g_strfreev(argvp); + } else { + g_warning("failed to execute '%s': %s", ob_restart_path, + err->message); + } } /* re-run me */ -- 2.45.2