From: Jo-Philipp Wich Date: Sun, 19 Jul 2009 02:39:10 +0000 (+0000) Subject: libs/nixio: don't close stdin, stdout or stderr during garbage collection X-Git-Tag: 0.10.0~1331 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=306b2d865a0f93faf389b86f6fee5041d3c881b2 libs/nixio: don't close stdin, stdout or stderr during garbage collection --- 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);