From: Wayne Davison Date: Fri, 30 Apr 2010 19:58:17 +0000 (-0700) Subject: May as well use do_mkdir() directly these days. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/9fbec6e44c7381ab28e78a991d37b57092459e99 May as well use do_mkdir() directly these days. --- diff --git a/backup.c b/backup.c index 6dbc17a0..e535e6f5 100644 --- a/backup.c +++ b/backup.c @@ -98,7 +98,7 @@ static BOOL copy_valid_path(const char *fname) for ( ; b; name = b + 1, b = strchr(name, '/')) { *b = '\0'; - while (mkdir_defmode(backup_dir_buf) < 0) { + while (do_mkdir(backup_dir_buf, ACCESSPERMS) < 0) { if (errno == EEXIST) { val = validate_backup_dir(); if (val > 0) diff --git a/main.c b/main.c index 66412916..0455734d 100644 --- a/main.c +++ b/main.c @@ -639,7 +639,7 @@ static char *get_local_name(struct file_list *flist, char *dest_path) exit_cleanup(RERR_SYNTAX); } - if (mkdir_defmode(dest_path) != 0) { + if (do_mkdir(dest_path, ACCESSPERMS) != 0) { rsyserr(FERROR, errno, "mkdir %s failed", full_fname(dest_path)); exit_cleanup(RERR_FILEIO); diff --git a/util.c b/util.c index 2c4c571e..02085d42 100644 --- a/util.c +++ b/util.c @@ -177,13 +177,6 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode) } } -/* This creates a new directory with default permissions. Now that we - * leave the original umask set, we can just mkdir with mode 777. */ -int mkdir_defmode(char *fname) -{ - return do_mkdir(fname, ACCESSPERMS); -} - /* Create any necessary directories in fname. Any missing directories are * created with default permissions. Returns < 0 on error, or the number * of directories created. */