From: Lennart Poettering Date: Fri, 29 Apr 2016 17:42:07 +0000 (+0200) Subject: copy: return the right error when we can't open a file X-Git-Tag: v230~102^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b498c53d80faf7ebd0df5888a48793889ee421e4;p=thirdparty%2Fsystemd.git copy: return the right error when we can't open a file --- diff --git a/src/basic/copy.c b/src/basic/copy.c index 3001234a010..c2baef6d224 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)