From b37e88b3d6128b85586231200c6d1a2f05ecd0d6 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Thu, 5 May 2016 12:29:05 +0300 Subject: Return errno from lfs.attributes on error --- src/lfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lfs.c b/src/lfs.c index d9b21e6..0387e15 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -800,7 +800,8 @@ static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) { if (st(file, &info)) { lua_pushnil(L); lua_pushfstring(L, "cannot obtain information from file '%s': %s", file, strerror(errno)); - return 2; + lua_pushinteger(L, errno); + return 3; } if (lua_isstring (L, 2)) { const char *member = lua_tostring (L, 2); -- cgit v1.2.3-55-g6feb