Changeset 5058
- Timestamp:
- 07/11/09 09:01:32 (4 years ago)
- Files:
-
- 1 modified
-
luci/trunk/libs/nixio/src/file.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/nixio/src/file.c
r4437 r5058 124 124 return nixio__perror(L); 125 125 } else { 126 int *udata = lua_newuserdata(L, sizeof(int)); 127 if (!udata) { 128 return luaL_error(L, "out of memory"); 129 } 130 131 *udata = stat; 132 luaL_getmetatable(L, NIXIO_FILE_META); 133 lua_setmetatable(L, -2); 126 if (newfd == -1) { 127 int *udata = lua_newuserdata(L, sizeof(int)); 128 if (!udata) { 129 return luaL_error(L, "out of memory"); 130 } 131 132 *udata = stat; 133 luaL_getmetatable(L, NIXIO_FILE_META); 134 lua_setmetatable(L, -2); 135 } else { 136 lua_pushvalue(L, 2); 137 } 134 138 return 1; 135 139 }
