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) | |
download | luafilesystem-b37e88b3d6128b85586231200c6d1a2f05ecd0d6.tar.gz luafilesystem-b37e88b3d6128b85586231200c6d1a2f05ecd0d6.tar.bz2 luafilesystem-b37e88b3d6128b85586231200c6d1a2f05ecd0d6.zip |
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*)) { | |||
800 | if (st(file, &info)) { | 800 | if (st(file, &info)) { |
801 | lua_pushnil(L); | 801 | lua_pushnil(L); |
802 | lua_pushfstring(L, "cannot obtain information from file '%s': %s", file, strerror(errno)); | 802 | lua_pushfstring(L, "cannot obtain information from file '%s': %s", file, strerror(errno)); |
803 | return 2; | 803 | lua_pushinteger(L, errno); |
804 | return 3; | ||
804 | } | 805 | } |
805 | if (lua_isstring (L, 2)) { | 806 | if (lua_isstring (L, 2)) { |
806 | const char *member = lua_tostring (L, 2); | 807 | const char *member = lua_tostring (L, 2); |