for DEBUG_LEAKS, prevent “leaking” of fds, even if they’re close-on-exit
This commit is contained in:
7
main.c
7
main.c
@ -34,7 +34,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.255 2013/02/10 17:43:07 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.256 2013/02/10 17:55:57 tg Exp $");
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
@ -1004,6 +1004,11 @@ quitenv(struct shf *shf)
|
|||||||
x_done();
|
x_done();
|
||||||
#endif
|
#endif
|
||||||
afreeall(APERM);
|
afreeall(APERM);
|
||||||
|
if (tty_fd >= 0)
|
||||||
|
close(tty_fd);
|
||||||
|
close(2);
|
||||||
|
close(1);
|
||||||
|
close(0);
|
||||||
#endif
|
#endif
|
||||||
exit(exstat & 0xFF);
|
exit(exstat & 0xFF);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user