Open config files in text mode when O_TEXT is defined. This helps on
[rsync/rsync.git] / clientserver.c
index 3f1f583..709057f 100644 (file)
@@ -502,6 +502,8 @@ int start_daemon(int f_in, int f_out)
                exit_cleanup(RERR_SYNTAX);
        }
 
+       log_init();
+
        if (!am_server) {
                set_socket_options(f_in, "SO_KEEPALIVE");
                set_socket_options(f_in, lp_socket_options());
@@ -512,7 +514,7 @@ int start_daemon(int f_in, int f_out)
 
        motd = lp_motd_file();
        if (motd && *motd) {
-               FILE *f = fopen(motd,"r");
+               FILE *f = fopen(motd,"r" O_TEXT_STR);
                while (f && !feof(f)) {
                        int len = fread(line, 1, sizeof(line)-1, f);
                        if (len > 0) {