svn commit: r295968 - user/pho/stress2/testcases/run
Peter Holm
pho at FreeBSD.org
Wed Feb 24 12:37:37 UTC 2016
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]);
More information about the svn-src-user
mailing list