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

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); fdf = openat(df, from, O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
else else
fdf = fcntl(df, F_DUPFD_CLOEXEC, 3); fdf = fcntl(df, F_DUPFD_CLOEXEC, 3);
if (fdf < 0)
return -errno;
d = fdopendir(fdf); d = fdopendir(fdf);
if (!d) if (!d)