dwm-meillo

diff util.c @ 9:d567f430a81d

fixed several stuff (gridwm gets better and better)
author Anselm R. Garbe <garbeam@wmii.de>
date Tue, 11 Jul 2006 12:52:57 +0200
parents e0cefb3981c8
children ea9c08ec4b48
line diff
     1.1 --- a/util.c	Tue Jul 11 11:50:18 2006 +0200
     1.2 +++ b/util.c	Tue Jul 11 12:52:57 2006 +0200
     1.3 @@ -93,11 +93,12 @@
     1.4  		return;
     1.5  	if(fork() == 0) {
     1.6  		if(fork() == 0) {
     1.7 -			setsid();
     1.8  			if(dpy)
     1.9  				close(ConnectionNumber(dpy));
    1.10 -			execlp(shell, "shell", "-c", cmd, NULL);
    1.11 -			fprintf(stderr, "gridwm: execvp %s", cmd);
    1.12 +			setsid();
    1.13 +			fprintf(stderr, "gridwm: execlp %s %s -c %s", shell, shell, cmd);
    1.14 +			execlp(shell, shell, "-c", cmd, NULL);
    1.15 +			fprintf(stderr, "gridwm: execlp %s", cmd);
    1.16  			perror(" failed");
    1.17  		}
    1.18  		exit (0);
    1.19 @@ -123,14 +124,14 @@
    1.20  	}
    1.21  
    1.22  	if(fork() == 0) {
    1.23 -		setsid();
    1.24  		if(dpy)
    1.25  			close(ConnectionNumber(dpy));
    1.26 +		setsid();
    1.27  		dup2(pfd[1], STDOUT_FILENO);
    1.28  		close(pfd[0]);
    1.29  		close(pfd[1]);
    1.30 -		execlp(shell, "shell", "-c", cmd, NULL);
    1.31 -		fprintf(stderr, "gridwm: execvp %s", cmd);
    1.32 +		execlp(shell, shell, "-c", cmd, NULL);
    1.33 +		fprintf(stderr, "gridwm: execlp %s", cmd);
    1.34  		perror(" failed");
    1.35  	}
    1.36  	else {