summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-07-19 02:39:10 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-07-19 02:39:10 +0000
commit306b2d865a0f93faf389b86f6fee5041d3c881b2 (patch)
tree665781df563344aeba9b9bcd0723937aff33555d /libs
parent074b5dfc4ab98edaaec7133fa03f505686c9f357 (diff)
libs/nixio: don't close stdin, stdout or stderr during garbage collection
Diffstat (limited to 'libs')
-rw-r--r--libs/nixio/src/file.c2
1 files changed, 1 insertions, 1 deletions
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);