diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-05 12:29:05 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-05 12:39:17 +0300 |
commit | b37e88b3d6128b85586231200c6d1a2f05ecd0d6 (patch) | |
tree | 103984236c0e3721bf32957f9ae6e14e1b86d4be | |
parent | 8f167ef1de6ecbe1a6b4b375c92c370b995c6874 (diff) |
Return errno from lfs.attributes on error
-rw-r--r-- | src/lfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |