summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-29 19:42:07 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-02 11:15:30 +0200
commitb498c53d80faf7ebd0df5888a48793889ee421e4 (patch)
tree09f636fc762a778dabf0394f51e613665d310c3d /src/basic
parent8120ee28b8d5d316d9ded9240bcccc9edb41ee06 (diff)
copy: return the right error when we can't open a file
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/copy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/copy.c b/src/basic/copy.c
index 3001234a01..c2baef6d22 100644
--- a/src/basic/copy.c
+++ b/src/basic/copy.c
@@ -305,6 +305,8 @@ static int fd_copy_directory(
fdf = openat(df, from, O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
else
fdf = fcntl(df, F_DUPFD_CLOEXEC, 3);
+ if (fdf < 0)
+ return -errno;
d = fdopendir(fdf);
if (!d)