X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=util.c;h=c0f248961241cb285381591b8e3f479e05d0dfc3;hb=16c67f32d62849792c8e6d4fdec22a1896f9c279;hp=de4df9857b52bc6e3b60027e2945251fb9c7f6e9;hpb=3a69c5173cdd24959410870bec2a10a76272e034;p=dwm.git diff --git a/util.c b/util.c index de4df98..c0f2489 100644 --- a/util.c +++ b/util.c @@ -93,11 +93,12 @@ spawn(Display *dpy, const char *cmd) return; if(fork() == 0) { if(fork() == 0) { - setsid(); if(dpy) close(ConnectionNumber(dpy)); - execlp(shell, "shell", "-c", cmd, NULL); - fprintf(stderr, "gridwm: execvp %s", cmd); + setsid(); + fprintf(stderr, "gridwm: execlp %s %s -c %s", shell, shell, cmd); + execlp(shell, shell, "-c", cmd, NULL); + fprintf(stderr, "gridwm: execlp %s", cmd); perror(" failed"); } exit (0); @@ -123,14 +124,14 @@ pipe_spawn(char *buf, unsigned int len, Display *dpy, const char *cmd) } if(fork() == 0) { - setsid(); if(dpy) close(ConnectionNumber(dpy)); + setsid(); dup2(pfd[1], STDOUT_FILENO); close(pfd[0]); close(pfd[1]); - execlp(shell, "shell", "-c", cmd, NULL); - fprintf(stderr, "gridwm: execvp %s", cmd); + execlp(shell, shell, "-c", cmd, NULL); + fprintf(stderr, "gridwm: execlp %s", cmd); perror(" failed"); } else {