From b498c53d80faf7ebd0df5888a48793889ee421e4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 29 Apr 2016 19:42:07 +0200 Subject: [PATCH] copy: return the right error when we can't open a file --- src/basic/copy.c | 2 ++ 1 file changed, 2 insertions(+) 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)