From 306b2d865a0f93faf389b86f6fee5041d3c881b2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 19 Jul 2009 02:39:10 +0000 Subject: [PATCH] libs/nixio: don't close stdin, stdout or stderr during garbage collection --- libs/nixio/src/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/nixio/src/file.c b/libs/nixio/src/file.c index 70c717e4e..9f99fb827 100644 --- a/libs/nixio/src/file.c +++ b/libs/nixio/src/file.c @@ -329,7 +329,7 @@ static int nixio_file_close(lua_State *L) { static int nixio_file__gc(lua_State *L) { int *fdp = luaL_checkudata(L, 1, NIXIO_FILE_META); int res; - if (*fdp != -1) { + if (*fdp > 2) { do { res = close(*fdp); } while (res == -1 && errno == EINTR); -- 2.25.1