]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Don't ignore return value of getcwd()
authorJiri Denemark <jdenemar@redhat.com>
Fri, 3 Dec 2010 16:10:31 +0000 (17:10 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 6 Dec 2010 09:12:01 +0000 (10:12 +0100)
tests/commandhelper.c

index 2ee9153d7b83130b466dfe8a3d4a71f0f7dc77b7..5b2f301f2ccaf5b57e1dbf624d4be359af624c57 100644 (file)
@@ -97,7 +97,8 @@ int main(int argc, char **argv) {
 
     fprintf(log, "DAEMON:%s\n", getppid() == 1 ? "yes" : "no");
     char cwd[1024];
-    getcwd(cwd, sizeof(cwd));
+    if (!getcwd(cwd, sizeof(cwd)))
+        return EXIT_FAILURE;
     if (strlen(cwd) > strlen("/commanddata") &&
         STREQ(cwd + strlen(cwd) - strlen("/commanddata"), "/commanddata"))
         strcpy(cwd, ".../commanddata");