X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/b9f592fbf50b0dc9e3d1d33b8deb2bf9abad9ef6..2c713fcdfa04eb7d58c67a4a51d4cbdc37f78536:/main.c diff --git a/main.c b/main.c index b34127c1..a94dfe8f 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,7 @@ extern char *files_from; extern char *remote_filesfrom_file; extern char *rsync_path; extern char *shell_cmd; -extern char *batch_prefix; +extern char *batch_name; /* there's probably never more than at most 2 outstanding child processes, @@ -598,7 +598,7 @@ void start_server(int f_in, int f_out, int argc, char *argv[]) if (am_sender) { keep_dirlinks = 0; /* Must be disabled on the sender. */ - + recv_exclude_list(f_in); if (cvs_exclude) add_cvs_excludes(); @@ -1074,12 +1074,16 @@ int main(int argc,char *argv[]) if (write_batch) write_batch_argvs_file(orig_argc, orig_argv); - batch_fd = do_open(batch_prefix, + if (read_batch && strcmp(batch_name, "-") == 0) + batch_fd = STDIN_FILENO; + else { + batch_fd = do_open(batch_name, write_batch ? O_WRONLY | O_CREAT | O_TRUNC : O_RDONLY, S_IRUSR | S_IWUSR); + } if (batch_fd < 0) { rsyserr(FERROR, errno, "Batch file %s open error", - batch_prefix); + batch_name); exit_cleanup(RERR_FILEIO); } }