[libvirt PATCH 14/32] src: replace mkdir() with g_mkdir()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



g_mkdir() provides portability to Windows platforms.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/util/virfile.c       | 2 +-
 tests/virlockspacetest.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 51a0d40b50..d0e0062aa7 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -3029,7 +3029,7 @@ virFileMakePathHelper(char *path, mode_t mode)
         *p = '/';
     }
 
-    if (mkdir(path, mode) < 0 && errno != EEXIST)
+    if (g_mkdir(path, mode) < 0 && errno != EEXIST)
         return -1;
 
     return 0;
diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c
index 57deb288a9..40395e8c72 100644
--- a/tests/virlockspacetest.c
+++ b/tests/virlockspacetest.c
@@ -300,7 +300,7 @@ static int testLockSpaceResourceLockPath(const void *args G_GNUC_UNUSED)
     if (!(lockspace = virLockSpaceNew(NULL)))
         goto cleanup;
 
-    if (mkdir(LOCKSPACE_DIR, 0700) < 0)
+    if (g_mkdir(LOCKSPACE_DIR, 0700) < 0)
         goto cleanup;
 
     if (virLockSpaceCreateResource(lockspace, LOCKSPACE_DIR "/foo") < 0)
-- 
2.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux