May as well use do_mkdir() directly these days.
authorWayne Davison <wayned@samba.org>
Fri, 30 Apr 2010 19:58:17 +0000 (12:58 -0700)
committerWayne Davison <wayned@samba.org>
Fri, 30 Apr 2010 19:58:17 +0000 (12:58 -0700)
backup.c
main.c
util.c

index 6dbc17a..e535e6f 100644 (file)
--- 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';
 
        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)
                        if (errno == EEXIST) {
                                val = validate_backup_dir();
                                if (val > 0)
diff --git a/main.c b/main.c
index 6641291..0455734 100644 (file)
--- 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);
                }
 
                        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);
                        rsyserr(FERROR, errno, "mkdir %s failed",
                                full_fname(dest_path));
                        exit_cleanup(RERR_FILEIO);
diff --git a/util.c b/util.c
index 2c4c571..02085d4 100644 (file)
--- 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. */
 /* Create any necessary directories in fname.  Any missing directories are
  * created with default permissions.  Returns < 0 on error, or the number
  * of directories created. */