diff --git a/src/lfs.c b/src/lfs.c index 68040d4..df7ec2c 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -360,11 +360,7 @@ static int lfs_g_setmode (lua_State *L, FILE *f, int arg) { lua_pushnil(L); return 2; } else { - int en = errno; - lua_pushnil(L); - lua_pushfstring(L, "%s", strerror(en)); - lua_pushinteger(L, en); - return 3; + return pusherror(L, NULL); } }