Point out that the file_struct in log_delete is zero-initialized because
[rsync/rsync.git] / log.c
diff --git a/log.c b/log.c
index c08dd58..46e0a63 100644 (file)
--- a/log.c
+++ b/log.c
@@ -37,8 +37,6 @@ extern int protocol_version;
 extern int always_checksum;
 extern int preserve_times;
 extern int msgs2stderr;
-extern int uid_ndx;
-extern int gid_ndx;
 extern int stdout_format_has_i;
 extern int stdout_format_has_o_or_i;
 extern int logfile_format_has_i;
@@ -100,7 +98,6 @@ struct {
        { RERR_DEL_LIMIT  , "the --max-delete limit stopped deletions" },
        { RERR_TIMEOUT    , "timeout in data send/receive" },
        { RERR_CONTIMEOUT , "timeout waiting for daemon connection" },
-       { RERR_RCVR_ERROR , "exiting due to receiver error" },
        { RERR_CMD_FAILED , "remote shell failed" },
        { RERR_CMD_KILLED , "remote shell killed" },
        { RERR_CMD_RUN    , "remote command could not be run" },
@@ -347,7 +344,7 @@ output_msg:
        case FCLIENT:
                break;
        default:
-               fprintf(stderr, "Unknown logcode in rwrite(): %d\n", (int)code);
+               fprintf(stderr, "Unknown logcode in rwrite(): %d [%s]\n", (int)code, who_am_i());
                exit_cleanup(RERR_MESSAGEIO);
        }
 
@@ -851,10 +848,11 @@ void maybe_log_item(struct file_struct *file, int iflags, int itemizing,
 
 void log_delete(const char *fname, int mode)
 {
+       /* Zero-initialized */
        static struct {
                union file_extras ex[4]; /* just in case... */
                struct file_struct file;
-       } x;
+       } x; /* Zero-initialized due to static declaration. */
        int len = strlen(fname);
        const char *fmt;