1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-09 23:34:14 +01:00

Coverity: fix WPrefs appearance time of check time of use

This commit is contained in:
David Maciejak
2023-03-02 23:05:41 +08:00
committed by Carlos R. Mafra
parent 9e59d19507
commit e9717ed719

View File

@@ -1831,7 +1831,7 @@ static void createPanel(Panel * p)
panel->fprefix = wstrconcat(wuserdatapath(), "/" PACKAGE_TARNAME);
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
werror("%s", panel->fprefix);
ok = False;
}
@@ -1841,7 +1841,7 @@ static void createPanel(Panel * p)
wfree(panel->fprefix);
panel->fprefix = tmp;
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
werror("%s", panel->fprefix);
}
}