X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fnixio%2Fsrc%2Ffile.c;h=b86e040e1d02e628105c3f88d7ed7081cef09eb6;hp=bb9e0844b2498b14dc9aac32b4c3e22a16670016;hb=87491bf031881a4f5b828aaf6826cf98bda1252e;hpb=7f9c9d208e2465e80cba92dcc8d450022a8cfd1e diff --git a/libs/nixio/src/file.c b/libs/nixio/src/file.c index bb9e0844b2..b86e040e1d 100644 --- a/libs/nixio/src/file.c +++ b/libs/nixio/src/file.c @@ -226,7 +226,7 @@ static int nixio_file_read(lua_State *L) { static int nixio_file_seek(lua_State *L) { int fd = nixio__checkfd(L, 1); - off_t len = (off_t)luaL_checkinteger(L, 2); + off_t len = (off_t)nixio__checknumber(L, 2); int whence; const char *whstr = luaL_optlstring(L, 3, "set", NULL); if (!strcmp(whstr, "set")) { @@ -242,7 +242,7 @@ static int nixio_file_seek(lua_State *L) { if (len == -1) { return nixio__perror(L); } else { - lua_pushinteger(L, len); + nixio__pushnumber(L, len); return 1; } } @@ -253,7 +253,7 @@ static int nixio_file_tell(lua_State *L) { if (pos < 0) { return nixio__perror(L); } else { - lua_pushinteger(L, pos); + nixio__pushnumber(L, pos); return 1; } } @@ -291,7 +291,7 @@ static int nixio_file_sync(lua_State *L) { static int nixio_file_lock(lua_State *L) { int fd = nixio__checkfd(L, 1); const char *flag = luaL_checkstring(L, 2); - off_t len = (off_t)luaL_optinteger(L, 3, 0); + off_t len = (off_t)nixio__optnumber(L, 3, 0); int stat; int cmd = 0;