Skip to content

Commit 175a01c

Browse files
committed
fix log message when generating backup files, demote log level
log level of an "expected result" message should not be warning. Also use consistent octal format for unix permissions, and add a missing newline.
1 parent 999f153 commit 175a01c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

daemon.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,13 @@ int csync_setBackupFileStatus(char *filename, int backupDirLength)
264264
struct stat buf;
265265
int rc = stat((filename + backupDirLength), &buf);
266266
if (rc == 0) {
267-
csync_debug(0, "Stating original file %s rc: %d mode: %o", (filename + backupDirLength), rc, buf.st_mode);
267+
csync_debug(1, "Stating original file %s rc: %d mode: %o \n", (filename + backupDirLength), rc, buf.st_mode);
268268

269269
rc = chown(filename, buf.st_uid, buf.st_gid);
270-
csync_debug(0, "Changing owner of %s to user %d and group %d, rc= %d \n", filename, buf.st_uid, buf.st_gid, rc);
270+
csync_debug(rc == 0, "Changing owner of %s to user %d and group %d, rc= %d \n", filename, buf.st_uid, buf.st_gid, rc);
271271

272272
rc = chmod(filename, buf.st_mode);
273-
csync_debug(0, "Changing mode of %s to mode %d, rc= %d \n", filename, buf.st_mode, rc);
273+
csync_debug(rc == 0, "Changing mode of %s to mode %o, rc= %d \n", filename, buf.st_mode, rc);
274274

275275
} else {
276276
csync_debug(0, "Error getting mode and owner ship from %s \n", (filename + backupDirLength));

0 commit comments

Comments
 (0)