From: Jiri Denemark Date: Fri, 3 Dec 2010 16:10:31 +0000 (+0100) Subject: tests: Don't ignore return value of getcwd() X-Git-Tag: v0.8.7~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58d0f4d737d4de688c0a473ef4a073f07d869a09;p=thirdparty%2Flibvirt.git tests: Don't ignore return value of getcwd() --- diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 2ee9153d7b..5b2f301f2c 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -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");