summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-20 00:20:35 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-20 00:20:35 +0200
commit2c455af4c765463c75df79acba34d2347c03cbff (patch)
treebce8eb308fd2818b9bb11fa0a0d880ac46ba788a
parent497d1986c13032f1ef8f4592bb7ed8d3aa321a47 (diff)
copy: don't eat up error from chown()/chmod()
The idea was to not fail on, nor to ignore errors from chown()/chmod(), but to proceed and simply return the most recent error...
-rw-r--r--src/shared/copy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/copy.c b/src/shared/copy.c
index 867e49bf89..7c3fab6901 100644
--- a/src/shared/copy.c
+++ b/src/shared/copy.c
@@ -179,6 +179,8 @@ static int fd_copy_directory(int df, const char *from, const struct stat *st, in
if (fdt < 0)
return -errno;
+ r = 0;
+
if (created) {
if (fchown(fdt, st->st_uid, st->st_gid) < 0)
r = -errno;
@@ -187,7 +189,6 @@ static int fd_copy_directory(int df, const char *from, const struct stat *st, in
r = -errno;
}
- r = 0;
FOREACH_DIRENT(de, d, return -errno) {
struct stat buf;
int q;