Date: Wed, 24 Feb 2016 12:37:35 +0000 (UTC) From: Peter Holm <pho@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r295968 - user/pho/stress2/testcases/run Message-ID: <201602241237.u1OCbZYB007669@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pho Date: Wed Feb 24 12:37:35 2016 New Revision: 295968 URL: https://svnweb.freebsd.org/changeset/base/295968 Log: Handle null arguments. While here order the include files. Sponsored by: EMC / Isilon Storage Division Modified: user/pho/stress2/testcases/run/run.c Modified: user/pho/stress2/testcases/run/run.c ============================================================================== --- user/pho/stress2/testcases/run/run.c Wed Feb 24 12:28:49 2016 (r295967) +++ user/pho/stress2/testcases/run/run.c Wed Feb 24 12:37:35 2016 (r295968) @@ -30,14 +30,15 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <libgen.h> -#include <time.h> #include <sys/param.h> #include <sys/wait.h> + #include <err.h> +#include <libgen.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <unistd.h> #include "stress.h" @@ -105,6 +106,9 @@ test(void) fflush(stdout); for (i = 0; i < op->argc; i++) { + r[i] = 0; + if (op->argv[i][0] == 0) + continue; if ((r[i] = fork()) == 0) { snprintf(fullpath, sizeof(fullpath), "%s/%s", home, op->argv[i]);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602241237.u1OCbZYB007669>