VLSub: Handle mkdir errors

This commit is contained in:
Hugo Beauzée-Luyssen 2018-04-11 12:48:56 +02:00
parent 4b4b2df3df
commit 34bfcde533
1 changed files with 2 additions and 1 deletions

View File

@ -667,7 +667,8 @@ function check_config()
openSub.conf.dirPath = vlc.config.userdatadir()
local subdirs = { "lua", "extensions", "userdata", "vlsub" }
for _, dir in ipairs(subdirs) do
if not vlc.io.mkdir( openSub.conf.dirPath .. slash .. dir, "0700" ) then
local res, err = vlc.io.mkdir( openSub.conf.dirPath .. slash .. dir, "0700" )
if res ~= 0 and err ~= vlc.errno.EEXIST then
vlc.msg.warn("Failed to create " .. openSub.conf.dirPath .. slash .. dir )
return false
end