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: v231.3~167 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=3124bef9cf7c0f7be0584d41e249dc7d6f0ad4b4 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 397a94766..24e03a705 100644 --- a/src/basic/copy.c +++ b/src/basic/copy.c @@ -267,6 +267,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)