X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/d2004814f03a900707c7ef021f9a367bb6b9b498..9a7532e516a6153ba6c59a59c329345509536a98:/support/savetransfer.c diff --git a/support/savetransfer.c b/support/savetransfer.c index 00778be7..808a6f25 100644 --- a/support/savetransfer.c +++ b/support/savetransfer.c @@ -7,20 +7,13 @@ * -o Save the output coming from PROGRAM to the OUTPUT_FILE * * If you want to capture the flow of data for an rsync command, use one of - * the following commands (the first two are push commands, the last two are - * pull commands): + * the following commands (the resulting files should be identical): * - * rsync -av --rsh="savetransfer -i /tmp/from.sender ssh" - * --rsync-path="savetransfer -i /tmp/to.receiver rsync" FILES HOST:DEST + * rsync -av --rsh="savetransfer -i /tmp/to.server ssh" + * --rsync-path="savetransfer -i /tmp/from.client rsync" SOURCE DEST * - * rsync -av --rsh="savetransfer -o /tmp/to.sender ssh" - * --rsync-path="savetransfer -o /tmp/from.generator rsync" FILES HOST:DEST - * - * rsync -av --rsh="savetransfer -i /tmp/from.generator ssh" - * --rsync-path="savetransfer -i /tmp/to.sender rsync" HOST:FILES DEST - * - * rsync -av --rsh="savetransfer -o /tmp/to.receiver ssh" - * --rsync-path="savetransfer -o /tmp/from.sender rsync" HOST:FILES DEST + * rsync -av --rsh="savetransfer -o /tmp/from.server ssh" + * --rsync-path="savetransfer -o /tmp/to.client rsync" SOURCE DEST * * Note that this program aborts after 30 seconds of inactivity, so you'll need * to change it if that is not enough dead time for your transfer. Also, some @@ -34,6 +27,10 @@ #define TIMEOUT_SECONDS 30 +#ifdef HAVE_SIGACTION +static struct sigaction sigact; +#endif + void run_program(char **command); char buf[4096]; @@ -71,7 +68,7 @@ main(int argc, char *argv[]) } set_blocking(fd_file); - signal(SIGPIPE, SIG_IGN); + SIGACTION(SIGPIPE, SIG_IGN); run_program(argv + 1);