Check if path exists before trying to create

This commit is contained in:
Arun Prakash Jana 2020-01-22 20:09:16 +05:30
parent a87be62204
commit 60dfb79b8d
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -5796,7 +5796,7 @@ static bool setup_config(void)
xstrlcpy(plugindir, cfgdir, len);
DPRINTF_S(plugindir);
if (!xmktree(plugindir, TRUE)) {
if (access(plugindir, F_OK) && !xmktree(plugindir, TRUE)) {
xerror();
return FALSE;
}
@ -5808,7 +5808,7 @@ static bool setup_config(void)
xstrlcpy(sessiondir, cfgdir, len);
DPRINTF_S(sessiondir);
if (!xmktree(sessiondir, TRUE)) {
if (access(sessiondir, F_OK) && !xmktree(sessiondir, TRUE)) {
xerror();
return FALSE;
}