[vlc-devel] [PATCH 3/3] VLSub: Handle mkdir errors

Rémi Denis-Courmont remi at remlab.net
Wed Apr 11 14:02:00 CEST 2018


Le 11 avril 2018 13:59:50 GMT+03:00, "Hugo Beauzée-Luyssen" <hugo at beauzee.fr> a écrit :
>---
> share/lua/extensions/VLSub.lua | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/share/lua/extensions/VLSub.lua
>b/share/lua/extensions/VLSub.lua
>index 0306cc1d62..4539869839 100644
>--- a/share/lua/extensions/VLSub.lua
>+++ b/share/lua/extensions/VLSub.lua
>@@ -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
>-- 
>2.11.0
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

The whole point of adding EEXIST is that we cannot take it for granted that the directory is usable.
-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


More information about the vlc-devel mailing list