drop unnecessary check around close

This commit is contained in:
Omar Polo 2021-02-03 16:53:34 +00:00
parent 4e2e2ab1d3
commit e824d03efa
1 changed files with 2 additions and 8 deletions

10
gmid.c
View File

@ -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();