From 84e1191db905d020860581edfe9dd079d96662a2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 19 Jan 2018 19:12:40 -0500 Subject: [PATCH] Don't close Unix's stdio handles when unloading doscalls library. --- native/doscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/doscalls.c b/native/doscalls.c index bbd8841..24b44ec 100644 --- a/native/doscalls.c +++ b/native/doscalls.c @@ -2926,7 +2926,7 @@ LX_NATIVE_MODULE_DEINIT({ } // for for (uint32 i = 0; i < MaxHFiles; i++) { - if (HFiles[i].fd != -1) + if (HFiles[i].fd > 2) // don't close -1, or any stdio handles. close(HFiles[i].fd); } // for free(HFiles);