mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-23 19:43:06 +00:00
Return errno from lfs.rmdir on error
This commit is contained in:
14
src/lfs.c
14
src/lfs.c
@@ -458,18 +458,8 @@ static int make_dir (lua_State *L) {
|
||||
** @param #1 Directory path.
|
||||
*/
|
||||
static int remove_dir (lua_State *L) {
|
||||
const char *path = luaL_checkstring (L, 1);
|
||||
int fail;
|
||||
|
||||
fail = rmdir (path);
|
||||
|
||||
if (fail) {
|
||||
lua_pushnil (L);
|
||||
lua_pushfstring (L, "%s", strerror(errno));
|
||||
return 2;
|
||||
}
|
||||
lua_pushboolean (L, 1);
|
||||
return 1;
|
||||
const char *path = luaL_checkstring(L, 1);
|
||||
return pushresult(L, rmdir(path), NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user