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

This commit is contained in:
Lennart Poettering 2016-04-29 19:42:07 +02:00
parent 8120ee28b8
commit b498c53d80
1 changed files with 2 additions and 0 deletions

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)