spawn: reduce 2 lines, change fprintf() + perror() + exit() to die("... :")

when calling die and the last character of the string corresponds to
':', die() will call perror(). See util.c

Also change EXIT_SUCCESS to EXIT_FAILURE
This commit is contained in:
explosion-mental 2022-07-29 18:26:04 -05:00 committed by Hiltjo Posthuma
parent 786f6e2a6f
commit 5b2e5e7a40
1 changed files with 1 additions and 3 deletions

4
dwm.c
View File

@ -1653,9 +1653,7 @@ spawn(const Arg *arg)
close(ConnectionNumber(dpy)); close(ConnectionNumber(dpy));
setsid(); setsid();
execvp(((char **)arg->v)[0], (char **)arg->v); execvp(((char **)arg->v)[0], (char **)arg->v);
fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]);
perror(" failed");
exit(EXIT_SUCCESS);
} }
} }