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
Fixed a problem with the last change.
[rsync/rsync.git]
/
main.c
diff --git
a/main.c
b/main.c
index
fc48c01
..
62a2b4d
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-23,19
+23,20
@@
time_t starttime = 0;
time_t starttime = 0;
-extern struct stats stats;
+extern int verbose;
+extern int dry_run;
+extern int list_only;
extern int am_root;
extern int am_server;
extern int am_sender;
extern int am_generator;
extern int am_daemon;
extern int am_root;
extern int am_server;
extern int am_sender;
extern int am_generator;
extern int am_daemon;
-extern int verbose;
extern int blocking_io;
extern int delete_before;
extern int blocking_io;
extern int delete_before;
+extern int remove_sent_files;
extern int daemon_over_rsh;
extern int daemon_over_rsh;
+extern int need_messages_from_generator;
extern int do_stats;
extern int do_stats;
-extern int dry_run;
-extern int list_only;
extern int log_got_error;
extern int module_id;
extern int orig_umask;
extern int log_got_error;
extern int module_id;
extern int orig_umask;
@@
-44,8
+45,10
@@
extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
extern int recurse;
extern int preserve_hard_links;
extern int protocol_version;
extern int recurse;
+extern int fuzzy_basis;
extern int relative_paths;
extern int rsync_port;
extern int relative_paths;
extern int rsync_port;
+extern int inplace;
extern int whole_file;
extern int read_batch;
extern int write_batch;
extern int whole_file;
extern int read_batch;
extern int write_batch;
@@
-53,6
+56,7
@@
extern int batch_fd;
extern int batch_gen_fd;
extern int filesfrom_fd;
extern pid_t cleanup_child_pid;
extern int batch_gen_fd;
extern int filesfrom_fd;
extern pid_t cleanup_child_pid;
+extern struct stats stats;
extern char *files_from;
extern char *remote_filesfrom_file;
extern char *partial_dir;
extern char *files_from;
extern char *remote_filesfrom_file;
extern char *partial_dir;
@@
-222,7
+226,7
@@
static void report(int f)
**/
static void show_malloc_stats(void)
{
**/
static void show_malloc_stats(void)
{
-#if HAVE_MALLINFO
+#if
def
HAVE_MALLINFO
struct mallinfo mi;
mi = mallinfo();
struct mallinfo mi;
mi = mallinfo();
@@
-292,7
+296,7
@@
static pid_t do_cmd(char *cmd, char *machine, char *user, char *path,
dash_l_set = 1;
}
dash_l_set = 1;
}
-#if HAVE_REMSH
+#if
def
HAVE_REMSH
/* remsh (on HPUX) takes the arguments the other way around */
args[argc++] = machine;
if (user && !(daemon_over_rsh && dash_l_set)) {
/* remsh (on HPUX) takes the arguments the other way around */
args[argc++] = machine;
if (user && !(daemon_over_rsh && dash_l_set)) {
@@
-440,6
+444,12
@@
static void do_server_sender(int f_in, int f_out, int argc,char *argv[])
exit_cleanup(RERR_SYNTAX);
return;
}
exit_cleanup(RERR_SYNTAX);
return;
}
+ if (am_daemon && lp_read_only(module_id) && remove_sent_files) {
+ rprintf(FERROR,
+ "ERROR: --remove-sent-files cannot be used with a read-only module\n");
+ exit_cleanup(RERR_SYNTAX);
+ return;
+ }
if (!relative_paths && !push_dir(dir)) {
rsyserr(FERROR, errno, "push_dir#3 %s failed",
if (!relative_paths && !push_dir(dir)) {
rsyserr(FERROR, errno, "push_dir#3 %s failed",
@@
-488,7
+498,8
@@
static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
int pid;
int status = 0;
int error_pipe[2], name_pipe[2];
int pid;
int status = 0;
int error_pipe[2], name_pipe[2];
- BOOL need_name_pipe = (basis_dir[0] || partial_dir) && !dry_run;
+ BOOL need_name_pipe = (basis_dir[0] || partial_dir || fuzzy_basis
+ || inplace) && !dry_run;
/* The receiving side mustn't obey this, or an existing symlink that
* points to an identical file won't be replaced by the referent. */
/* The receiving side mustn't obey this, or an existing symlink that
* points to an identical file won't be replaced by the referent. */
@@
-670,6
+681,8
@@
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. */
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
+ if (need_messages_from_generator)
+ io_start_multiplex_in();
recv_filter_list(f_in);
do_server_sender(f_in, f_out, argc, argv);
recv_filter_list(f_in);
do_server_sender(f_in, f_out, argc, argv);
@@
-747,6
+760,9
@@
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
exit_cleanup(status);
}
exit_cleanup(status);
}
+ if (need_messages_from_generator && !read_batch)
+ io_start_multiplex_out();
+
if (argc == 0)
list_only |= 1;
if (argc == 0)
list_only |= 1;
@@
-1171,9
+1187,6
@@
int main(int argc,char *argv[])
exit_cleanup(RERR_SYNTAX);
}
exit_cleanup(RERR_SYNTAX);
}
- if (dry_run)
- verbose = MAX(verbose,1);
-
if (am_server) {
set_nonblocking(STDIN_FILENO);
set_nonblocking(STDOUT_FILENO);
if (am_server) {
set_nonblocking(STDIN_FILENO);
set_nonblocking(STDOUT_FILENO);