Fix Psssible race condition in g_create_path()
(cherry picked from commit 2e597120443c7dcb0b32f6078999098a364f9543)
This commit is contained in:
+4
-1
@@ -2764,7 +2764,10 @@ g_create_path(const char *path)
|
||||
|
||||
if (!g_directory_exist(copypath))
|
||||
{
|
||||
if (!g_create_dir(copypath))
|
||||
// Create and check again to avoid a race with another
|
||||
// process making the same traversal
|
||||
(void)g_create_dir(copypath);
|
||||
if (!g_directory_exist(copypath))
|
||||
{
|
||||
status = 0;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user