copy: return the right error when we can't open a file

This commit is contained in:
Lennart Poettering
2016-05-02 11:15:30 +02:00
parent 8120ee28b8
commit b498c53d80
+2
View File
@@ -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)