First let me say that udpcast is a great tool. I use it in SystemImager
as a multicast transport option, and it works quite well.
I do have one conundrum, however, in that I'm trying to do a
--pipe 'tar -x' on a busybox system, and regardless of the exit status
of the --pipe program (tar in this case), I get an exit status of 141
from udp-receiver. The files, however, are untarred successfully.
If I issue the same commands on a non-busy box system, things work fine.
If I receive the stream to a file, --file /tmp/out, udp-receiver exits
with a zero.
A statically compiled udp-receiver exhibits the same behavior.
This is with udpcast-20011231.
I have even applied the patch below, which produces appropriate exit
codes when run on a non-busybox system.
Help!
Thanks, -Brian
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 <finley(a)mcs.anl.gov>
+ * - retrieve status returned by waitForProcess as "pipeStatus", then
+ * exit with status of failed pipe program if status is non-zero.
+ */
+
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
@@ -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);
--
---------------------------------------------------------
Brian Elliott Finley Argonne, MCS Division
Phone: 630.631.6621
http://thefinleys.com
GPG: 3FF8 D096 0E0C D3F3 29B7 6518 D20B 1931 10F8 EE52
---------------------------------------------------------