summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/src/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/nixio/src/file.c')
-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);