static int nixio_file_seek(lua_State *L) {
int fd = nixio__checkfd(L, 1);
- off_t len = (off_t)luaL_checknumber(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")) {
if (len == -1) {
return nixio__perror(L);
} else {
- lua_pushnumber(L, len);
+ nixio__pushnumber(L, len);
return 1;
}
}
if (pos < 0) {
return nixio__perror(L);
} else {
- lua_pushnumber(L, pos);
+ nixio__pushnumber(L, pos);
return 1;
}
}
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_optnumber(L, 3, 0);
+ off_t len = (off_t)nixio__optnumber(L, 3, 0);
int stat;
int cmd = 0;