summaryrefslogtreecommitdiffstats
path: root/shared/process-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared/process-util.c')
-rw-r--r--shared/process-util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shared/process-util.c b/shared/process-util.c
index e36c647..fe895d2 100644
--- a/shared/process-util.c
+++ b/shared/process-util.c
@@ -68,7 +68,8 @@ fdstr_close_all(struct fdstr *s)
unsigned i;
for (i = 0; i < ARRAY_LENGTH(s->fds); i++) {
- close(s->fds[i]);
+ if (s->fds[i] >= 0)
+ close(s->fds[i]);
s->fds[i] = -1;
}
}