diff -urN udpcast-20011231sis2.orig/udpr-negotiate.c udpcast-20011231sis2/udpr-negotiate.c --- udpcast-20011231sis2.orig/udpr-negotiate.c 2001-12-30 18:07:02.000000000 -0600 +++ udpcast-20011231sis2/udpr-negotiate.c 2003-11-06 10:05:27.000000000 -0600 @@ -1,3 +1,9 @@ +/* + * 2003.11.06 Brian E. Finley + * - retrieve status returned by waitForProcess as "pipeStatus", then + * exit with status of failed pipe program if status is non-zero. + */ + #include #include #include @@ -297,6 +303,8 @@ { struct fifo fifo; void *returnValue; + int pipeStatus; + receiver_stats_t stats = allocReadStats(origOutFile); initFifo(&fifo, net_config->blockSize); @@ -315,7 +323,11 @@ /* if we have a pipe, now wait for that too */ if(pipePid) { - waitForProcess(pipePid, "Pipe"); + pipeStatus = waitForProcess(pipePid, "Pipe"); + if(pipeStatus != 0) { + fsync(origOutFile); + exit(pipeStatus); + } } fsync(origOutFile); displayReceiverStats(stats);