From 655ec8baa3e1e2c3f0fc13845f9b3f86416ec944 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Mon, 25 Apr 2016 15:36:37 +0300 Subject: Use pusherror in lfs_g_setmode --- src/lfs.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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); } } -- cgit v1.2.3-55-g6feb