diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2010-10-27 02:36:42 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2010-10-27 02:36:42 +0200 |
commit | 28113637f563534c5b4e1a462c39069b837d31d9 (patch) | |
tree | bab920c357a9189e1dc18604b15b4cfc2c51ff72 | |
parent | 03f337dabca8598623fc3197cb2579db4ecb0a93 (diff) | |
download | patch-28113637f563534c5b4e1a462c39069b837d31d9.tar.gz |
A minor set_file_attributes() cleanup
* src/util.c (set_file_attributes): Always expect the mode
argument to be set when FA_MODE is specified.
(create_backup_copy): Update accordingly.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/util.c | 4 |
2 files changed, 7 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2010-10-27 Andreas Gruenbacher <agruen@suse.de> + + * src/util.c (set_file_attributes): Always expect the mode argument to + be set when FA_MODE is specified. + (create_backup_copy): Update accordingly. + 2010-10-26 Andreas Gruenbacher <agruen@suse.de> * configure.ac: Remove obsolete checks for mktemp. @@ -172,8 +172,6 @@ set_file_attributes (char const *to, enum file_attributes attr, } if (attr & FA_MODE) { - if (! mode) - mode = st->st_mode; #if 0 && defined HAVE_LCHMOD /* The "diff --git" format does not store the file permissions of symlinks, so don't try to set symlink file permissions even on @@ -198,7 +196,7 @@ create_backup_copy (char const *from, char const *to, struct stat *st, to_dir_known_to_exist); if (remember_backup) insert_file (&backup_st); - set_file_attributes (to, FA_TIMES | FA_IDS | FA_MODE, st, 0, NULL); + set_file_attributes (to, FA_TIMES | FA_IDS | FA_MODE, st, st->st_mode, NULL); } void |