aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/liolib.c b/liolib.c
index 4895283f..1978c510 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.78 2008/02/12 16:51:03 roberto Exp roberto $ 2** $Id: liolib.c,v 2.79 2008/02/12 17:05:36 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -106,9 +106,14 @@ static int io_noclose (lua_State *L) {
106*/ 106*/
107static int io_pclose (lua_State *L) { 107static int io_pclose (lua_State *L) {
108 FILE **p = tofilep(L); 108 FILE **p = tofilep(L);
109 int ok = lua_pclose(L, *p); 109 int stat = lua_pclose(L, *p);
110 *p = NULL; 110 *p = NULL;
111 return pushresult(L, ok, NULL); 111 if (stat == -1) /* error? */
112 return pushresult(L, 0, NULL);
113 else {
114 lua_pushinteger(L, stat);
115 return 1; /* return status */
116 }
112} 117}
113 118
114 119