diff --git a/src/basic/namespace-util.c b/src/basic/namespace-util.c index 67bdaa19d5e..1fc593df409 100644 --- a/src/basic/namespace-util.c +++ b/src/basic/namespace-util.c @@ -62,21 +62,19 @@ int namespace_open(pid_t pid, int *pidns_fd, int *mntns_fd, int *netns_fd, int * } if (pidns_fd) - *pidns_fd = pidnsfd; + *pidns_fd = TAKE_FD(pidnsfd); if (mntns_fd) - *mntns_fd = mntnsfd; + *mntns_fd = TAKE_FD(mntnsfd); if (netns_fd) - *netns_fd = netnsfd; + *netns_fd = TAKE_FD(netnsfd); if (userns_fd) - *userns_fd = usernsfd; + *userns_fd = TAKE_FD(usernsfd); if (root_fd) - *root_fd = rfd; - - pidnsfd = mntnsfd = netnsfd = usernsfd = -1; + *root_fd = TAKE_FD(rfd); return 0; }