diff options
| author | Marius Halden <marius.h@lden.org> | 2015-10-29 03:43:51 +0100 | 
|---|---|---|
| committer | Marius Halden <marius.h@lden.org> | 2015-10-29 03:43:51 +0100 | 
| commit | 9eefb23b1596a53c05a7b198365729dccdcf97de (patch) | |
| tree | 716399139ba1ac839d48a6eb5519101ec4b4305d | |
| parent | 4058c3af39ea0bc93b2f98d5ef37a89a85fb96ee (diff) | |
| download | piper-9eefb23b1596a53c05a7b198365729dccdcf97de.tar.gz piper-9eefb23b1596a53c05a7b198365729dccdcf97de.tar.bz2 piper-9eefb23b1596a53c05a7b198365729dccdcf97de.tar.xz  | |
If terminating wait a second between signaling each program
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | piper.c | 9 | 
2 files changed, 8 insertions, 3 deletions
@@ -1,7 +1,7 @@  piper: piper.c -	${CC} -o piper -g -Wall -Werror piper.c +	${CC} -o piper -Wall -Werror piper.c  .PHONY: clean @@ -202,8 +202,13 @@ signal_procs()  {  	int i;  	for (i = 0; i < num_procs; i++) { -		if (procs[i].pid != -1) -			kill(procs[i].pid, sendsignal); //XXX: Check return? +		if (procs[i].pid == -1) +			continue; +			 +		kill(procs[i].pid, sendsignal); //XXX: Check return? +		 +		if (terminate) // If killing procs, sleep between signals +			sleep(1);  	}  	sendsignal = 0;  | 
