When running as --daemon in the background and using a "log file" rsyncd.conf
[rsync/rsync.git] / clientserver.c
index 459e222..0164d07 100644 (file)
@@ -37,7 +37,11 @@ int start_socket_client(char *host, char *path, int argc, char *argv[])
        extern int remote_version;
        extern int am_sender;
        extern struct in_addr socket_address;
-       extern int blocking_io;
+
+       if (argc == 0 && !am_sender) {
+               extern int list_only;
+               list_only = 1;
+       }
 
        if (*path == '/') {
                rprintf(FERROR,"ERROR: The remote path must start with a module name\n");
@@ -54,8 +58,6 @@ int start_socket_client(char *host, char *path, int argc, char *argv[])
        if (!user) user = getenv("USER");
        if (!user) user = getenv("LOGNAME");
 
-       blocking_io = 1;
-
        fd = open_socket_out(host, rsync_port, &socket_address);
        if (fd == -1) {
                exit_cleanup(RERR_SOCKETIO);
@@ -204,7 +206,7 @@ static int rsync_module(int fd, int i)
        p = lp_exclude(i);
        add_exclude_line(p);
 
-       log_open();
+       log_init();
 
        if (use_chroot) {
                if (chroot(lp_path(i))) {
@@ -447,7 +449,7 @@ int daemon_main(void)
                exit_cleanup(RERR_SYNTAX);
        }
 
-       log_open();
+       log_init();
 
        rprintf(FINFO,"rsyncd version %s starting\n",VERSION);