aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-03 16:53:34 +0000
committerOmar Polo <op@omarpolo.com>2021-02-03 16:53:34 +0000
commite824d03efa218415d3625d14d168dfc954b39ef6 (patch)
tree68991e34bf1d6b035928c687e36ba8df821f37c7 /gmid.c
parent4e2e2ab1d3ac93821434c5e7723ffbcda1b0aee4 (diff)
drop unnecessary check around close
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gmid.c b/gmid.c
index bf5bc16..d74e633 100644
--- a/gmid.c
+++ b/gmid.c
@@ -490,20 +490,14 @@ serve(int argc, char **argv, int *p)
fatal("fork: %s", strerror(errno));
case 0: /* child */
- if (p[0] != -1) {
- close(p[0]);
- p[0] = -1;
- }
+ close(p[0]);
exfd = p[1];
drop_priv();
listener_main();
_exit(0);
default: /* parent */
- if (p[1] != -1) {
- close(p[1]);
- p[1] = -1;
- }
+ close(p[1]);
exfd = p[0];
drop_priv();
return executor_main();