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...
This commit is contained in:
Lennart Poettering
2014-06-20 00:20:35 +02:00
parent 497d1986c1
commit 2c455af4c7
+2 -1
View File
@@ -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;