[vlc-devel] [PATCH 2/3] lua: io: Don't swallow EEXIST errors
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Wed Apr 11 12:59:49 CEST 2018
---
modules/lua/libs/io.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules/lua/libs/io.c b/modules/lua/libs/io.c
index acb94c491d..d92ae445fd 100644
--- a/modules/lua/libs/io.c
+++ b/modules/lua/libs/io.c
@@ -239,8 +239,10 @@ static int vlclua_mkdir( lua_State *L )
if ( !psz_dir || !psz_mode )
return vlclua_error( L );
int i_res = vlc_mkdir( psz_dir, strtoul( psz_mode, NULL, 0 ) );
- lua_pushboolean( L, i_res == 0 || errno == EEXIST );
- return 1;
+ int i_err = i_res != 0 ? errno : 0;
+ lua_pushinteger( L, i_res );
+ lua_pushinteger( L, i_err );
+ return 2;
}
static const luaL_Reg vlclua_io_reg[] = {
--
2.11.0
More information about the vlc-devel
mailing list