1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

fixed Restart() function, and crashing dialog call to this function

This commit is contained in:
dan
1999-04-17 20:25:07 +00:00
parent afcbe06363
commit 8bdc78fcd1
4 changed files with 18 additions and 28 deletions

View File

@@ -58,9 +58,6 @@
Display *dpy;
char **Arguments;
int ArgCount;
char *ProgName;
unsigned int ValidModMask = 0xff;
@@ -152,6 +149,10 @@ int wVisualID = -1;
static char *DisplayName = NULL;
static char **Arguments;
static int ArgCount;
extern void EventLoop();
extern void StartUp();
@@ -169,7 +170,7 @@ Exit(int status)
}
void
Restart(char *manager)
Restart(char *manager, Bool abortOnFailure)
{
char *prog=NULL;
char *argv[MAX_RESTART_ARGS];
@@ -191,16 +192,15 @@ Restart(char *manager)
XCloseDisplay(dpy);
dpy = NULL;
}
if (!prog)
execvp(Arguments[0], Arguments);
else {
execvp(prog, argv);
/* fallback */
execv(Arguments[0], Arguments);
if (!prog) {
execvp(Arguments[0], Arguments);
wfatal(_("failed to restart Window Maker."));
} else {
execvp(prog, argv);
wsyserror(_("could not exec %s"), prog);
}
wsyserror(_("could not exec window manager"));
wfatal(_("Restart failed!!!"));
exit(-1);
if (abortOnFailure)
exit(-1);
}