diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-04-29 19:42:07 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-06-16 10:12:58 +0200 |
commit | 3124bef9cf7c0f7be0584d41e249dc7d6f0ad4b4 (patch) | |
tree | 83b4db73635d1f4883e34648d3a2143eeb580e37 /src | |
parent | 5f7e5870f06e8ffa0603ae971de74e3f3f6344e5 (diff) |
copy: return the right error when we can't open a file
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/copy.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) |