Skip to content

Commit

Permalink
linux: ensure that group dir fd is closed
Browse files Browse the repository at this point in the history
The CLOEXEC flag on the fd will ensure that the directory is closed on
the child, but also need to close the fd in the parent.
  • Loading branch information
jcollie committed Feb 3, 2025
1 parent cdd2099 commit b7fa8e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/os/cgroup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pub fn cloneInto(cgroup: []const u8) !posix.pid_t {
}
};
assert(fd >= 0);
defer _ = linux.close(fd);

const args: extern struct {
flags: u64,
Expand Down

0 comments on commit b7fa8e5

Please sign in to comment.