Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keplerproject/luafilesystem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-05-05 12:29:05 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-05-05 12:39:17 +0300
commitb37e88b3d6128b85586231200c6d1a2f05ecd0d6 (patch)
tree103984236c0e3721bf32957f9ae6e14e1b86d4be
parent8f167ef1de6ecbe1a6b4b375c92c370b995c6874 (diff)
Return errno from lfs.attributes on error
-rw-r--r--src/lfs.c3
1 files changed, 2 insertions, 1 deletions
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);