Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do a better job of writing out the BATCH.sh file (i.e. quote special
[rsync/rsync.git]
/
main.c
diff --git
a/main.c
b/main.c
index
b34127c
..
c41e224
100644
(file)
--- 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 *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,
/* there's probably never more than at most 2 outstanding child processes,
@@
-425,8
+425,9
@@
static void do_server_sender(int f_in, int f_out, int argc,char *argv[])
exit_cleanup(0);
}
exit_cleanup(0);
}
- io_start_buffering_in(f_in);
- io_start_buffering_out(f_out);
+ io_start_buffering_in();
+ io_start_buffering_out();
+
send_files(flist,f_out,f_in);
io_flush(FULL_FLUSH);
report(f_out);
send_files(flist,f_out,f_in);
io_flush(FULL_FLUSH);
report(f_out);
@@
-494,7
+495,7
@@
static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
if (f_in != f_out)
close(f_in);
if (f_in != f_out)
close(f_in);
- io_start_buffering_out(
f_out
);
+ io_start_buffering_out();
set_msg_fd_in(error_pipe[0]);
set_msg_fd_in(error_pipe[0]);
@@
-546,7
+547,7
@@
static void do_server_recv(int f_in, int f_out, int argc,char *argv[])
}
}
}
}
- io_start_buffering_in(
f_in
);
+ io_start_buffering_in();
if (delete_mode && !delete_excluded)
recv_exclude_list(f_in);
if (delete_mode && !delete_excluded)
recv_exclude_list(f_in);
@@
-588,17
+589,18
@@
int child_main(int argc, char *argv[])
void start_server(int f_in, int f_out, int argc, char *argv[])
{
void start_server(int f_in, int f_out, int argc, char *argv[])
{
- setup_protocol(f_out, f_in);
-
set_nonblocking(f_in);
set_nonblocking(f_out);
set_nonblocking(f_in);
set_nonblocking(f_out);
+ io_set_sock_fds(f_in, f_out);
+ setup_protocol(f_out, f_in);
+
if (protocol_version >= 23)
if (protocol_version >= 23)
- io_start_multiplex_out(
f_out
);
+ io_start_multiplex_out();
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
-
+
recv_exclude_list(f_in);
if (cvs_exclude)
add_cvs_excludes();
recv_exclude_list(f_in);
if (cvs_exclude)
add_cvs_excludes();
@@
-635,14
+637,15
@@
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
set_nonblocking(f_out);
}
set_nonblocking(f_out);
}
+ io_set_sock_fds(f_in, f_out);
setup_protocol(f_out,f_in);
if (protocol_version >= 23 && !read_batch)
setup_protocol(f_out,f_in);
if (protocol_version >= 23 && !read_batch)
- io_start_multiplex_in(
f_in
);
+ io_start_multiplex_in();
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
- io_start_buffering_out(
f_out
);
+ io_start_buffering_out();
if (cvs_exclude)
add_cvs_excludes();
if (delete_mode && !delete_excluded)
if (cvs_exclude)
add_cvs_excludes();
if (delete_mode && !delete_excluded)
@@
-1074,12
+1077,16
@@
int main(int argc,char *argv[])
if (write_batch)
write_batch_argvs_file(orig_argc, orig_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);
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",
if (batch_fd < 0) {
rsyserr(FERROR, errno, "Batch file %s open error",
- batch_
prefix
);
+ batch_
name
);
exit_cleanup(RERR_FILEIO);
}
}
exit_cleanup(RERR_FILEIO);
}
}