forked from enlightenment/enlightenment
Check return value from mkdir
If mkdir fails, no need to stat. Fixes CID 1039963
This commit is contained in:
parent
c0fa42fcdd
commit
05f00710f2
|
@ -80,7 +80,8 @@ e_ipc_init(void)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/e-%s@%x",
|
snprintf(buf, sizeof(buf), "%s/e-%s@%x",
|
||||||
base, user, id1);
|
base, user, id1);
|
||||||
mkdir(buf, S_IRWXU);
|
if (mkdir(buf, S_IRWXU) < 0)
|
||||||
|
goto retry;
|
||||||
if (stat(buf, &st) == 0)
|
if (stat(buf, &st) == 0)
|
||||||
{
|
{
|
||||||
if ((st.st_uid == getuid()) &&
|
if ((st.st_uid == getuid()) &&
|
||||||
|
@ -94,6 +95,7 @@ e_ipc_init(void)
|
||||||
if (_e_ipc_server) break;
|
if (_e_ipc_server) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
retry:
|
||||||
id1 = rand();
|
id1 = rand();
|
||||||
}
|
}
|
||||||
if (!_e_ipc_server)
|
if (!_e_ipc_server)
|
||||||
|
|
Loading…
Reference in New Issue