From: Christian Brauner Date: Thu, 8 Jul 2021 12:49:26 +0000 (+0200) Subject: file_utils: surface ENOENT when falling back to openat() X-Git-Tag: lxc-5.0.0~141^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebb79ad32a3961ce7efc1eb0de3ddd58698df829;p=thirdparty%2Flxc.git file_utils: surface ENOENT when falling back to openat() Link: https://discuss.linuxcontainers.org/t/error-failed-to-retrieve-pid-of-executing-child-process Signed-off-by: Christian Brauner --- diff --git a/src/lxc/file_utils.c b/src/lxc/file_utils.c index e7e87de9b..13a870552 100644 --- a/src/lxc/file_utils.c +++ b/src/lxc/file_utils.c @@ -663,7 +663,11 @@ int open_at(int dfd, const char *path, unsigned int o_flags, if (errno != ENOSYS) return -errno; - return openat(dfd, path, o_flags, mode); + fd = openat(dfd, path, o_flags, mode); + if (fd < 0) + return -errno; + + return move_fd(fd); } int fd_make_nonblocking(int fd)