[libvirt] [PATCH 06/10] Check return on mkdir for LOCKSPACE_DIR

John Ferlan jferlan at redhat.com
Thu Jan 3 19:16:18 UTC 2013


---
 tests/virlockspacetest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c
index 8673700..7678396 100644
--- a/tests/virlockspacetest.c
+++ b/tests/virlockspacetest.c
@@ -293,7 +293,8 @@ static int testLockSpaceResourceLockPath(const void *args ATTRIBUTE_UNUSED)
 
     lockspace = virLockSpaceNew(NULL);
 
-    mkdir(LOCKSPACE_DIR, 0700);
+    if (mkdir(LOCKSPACE_DIR, 0700) < 0)
+        goto cleanup;
 
     if (virLockSpaceCreateResource(lockspace, LOCKSPACE_DIR "/foo") < 0)
         goto cleanup;
-- 
1.7.11.7




More information about the libvir-list mailing list