Skip to content

Commit

Permalink
Don't close Unix's stdio handles when unloading doscalls library.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 20, 2018
1 parent 644d055 commit 84e1191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion native/doscalls.c
Expand Up @@ -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);
Expand Down

0 comments on commit 84e1191

Please sign in to comment.