restart and catch errors appropriately
This commit is contained in:
parent
26f66bc932
commit
8758271498
1 changed files with 8 additions and 4 deletions
|
@ -176,16 +176,20 @@ int main(int argc, char **argv)
|
||||||
XCloseDisplay(ob_display);
|
XCloseDisplay(ob_display);
|
||||||
|
|
||||||
if (ob_restart) {
|
if (ob_restart) {
|
||||||
|
ob_restart_path = "";
|
||||||
if (ob_restart_path != NULL) {
|
if (ob_restart_path != NULL) {
|
||||||
int argcp;
|
int argcp;
|
||||||
char **argvp;
|
char **argvp;
|
||||||
GError *err;
|
GError *err = NULL;
|
||||||
|
|
||||||
/* run other shit */
|
/* 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);
|
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 */
|
/* re-run me */
|
||||||
|
|
Loading…
Reference in a new issue