summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-10-27 02:36:42 +0200
committerAndreas Gruenbacher <agruen@suse.de>2010-10-27 02:36:42 +0200
commit28113637f563534c5b4e1a462c39069b837d31d9 (patch)
treebab920c357a9189e1dc18604b15b4cfc2c51ff72
parent03f337dabca8598623fc3197cb2579db4ecb0a93 (diff)
downloadpatch-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--ChangeLog6
-rw-r--r--src/util.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e2a8dbc..2a0084a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/src/util.c b/src/util.c
index bd2f39d..22b19d0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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