diff options
| -rw-r--r-- | dwm.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1654,10 +1654,16 @@ void spawn(const Arg *arg) { struct sigaction sa; + pid_t pid; if (arg->v == dmenucmd) dmenumon[0] = '0' + selmon->num; - if (fork() == 0) { + + if ((pid = fork()) == -1) { + fprintf(stderr, "dwm: fork failed: %s\n", strerror(errno)); + return; + } + if (pid == 0) { if (dpy) close(ConnectionNumber(dpy)); setsid(); |
