From: explosion-mental Date: Fri, 29 Jul 2022 23:26:04 +0000 (-0500) Subject: spawn: reduce 2 lines, change fprintf() + perror() + exit() to die("... :") X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=5b2e5e7a4001479e4dc3e245f96e49f7ea0da658;p=suckless%2Fdwm.git 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 --- diff --git a/dwm.c b/dwm.c index c0c3b9b..61713b7 100644 --- a/dwm.c +++ b/dwm.c @@ -1653,9 +1653,7 @@ spawn(const Arg *arg) close(ConnectionNumber(dpy)); setsid(); execvp(((char **)arg->v)[0], (char **)arg->v); - fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); - perror(" failed"); - exit(EXIT_SUCCESS); + die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]); } }