aboutsummaryrefslogtreecommitdiffgithub
path: root/nsdo.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsdo.c')
-rw-r--r--nsdo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nsdo.c b/nsdo.c
index 7291641..4dc9fe6 100644
--- a/nsdo.c
+++ b/nsdo.c
@@ -165,7 +165,7 @@ int set_netns(char *ns) {
return 0;
}
- if ((nsfd = open(nspath, O_RDONLY)) == -1) {
+ if ((nsfd = open(nspath, O_RDONLY | O_CLOEXEC)) == -1) {
fprintf(stderr, PROGRAM ": open(\"%s\"): %s\n", nspath, strerror(errno));
return 0;
}