util.c
changeset 471 740c4bfc3124
parent 461 9d23330a5268
child 532 651f2c868b31
equal deleted inserted replaced
470:9d728cba93d6 471:740c4bfc3124
    45 	if(!shell && !(shell = getenv("SHELL")))
    45 	if(!shell && !(shell = getenv("SHELL")))
    46 		shell = "/bin/sh";
    46 		shell = "/bin/sh";
    47 
    47 
    48 	if(!arg->cmd)
    48 	if(!arg->cmd)
    49 		return;
    49 		return;
    50 	/* the double-fork construct avoids zombie processes */
    50 	/* The double-fork construct avoids zombie processes and keeps the code
       
    51 	 * clean from stupid signal handlers. */
    51 	if(fork() == 0) {
    52 	if(fork() == 0) {
    52 		if(fork() == 0) {
    53 		if(fork() == 0) {
    53 			if(dpy)
    54 			if(dpy)
    54 				close(ConnectionNumber(dpy));
    55 				close(ConnectionNumber(dpy));
    55 			setsid();
    56 			setsid();