From 46bbddc5a2384f25afa39a3cc5dea8b07f6310fa Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Thu, 5 May 2016 12:46:54 +0300 Subject: Return true instead of 0 on lfs.link success --- src/lfs.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/lfs.c b/src/lfs.c index 0387e15..6ee09b3 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -429,13 +429,7 @@ static int make_link (lua_State *L) { #ifndef _WIN32 const char *oldpath = luaL_checkstring(L, 1); const char *newpath = luaL_checkstring(L, 2); - int res = (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath); - if (res == -1) { - return pusherror(L, NULL); - } else { - lua_pushinteger(L, 0); - return 1; - } + return pushresult(L, (lua_toboolean(L, 3) ? symlink : link)(oldpath, newpath), NULL); #else errno = ENOSYS; /* = "Function not implemented" */ return pushresult(L, -1, "make_link is not supported on Windows"); -- cgit v1.2.3-55-g6feb