Fix Psssible race condition in g_create_path()

(cherry picked from commit 2e597120443c7dcb0b32f6078999098a364f9543)
This commit is contained in:
matt335672
2025-08-15 11:38:22 +01:00
parent 0c73ea5328
commit 092e430512
+4 -1
View File
@@ -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;