svn commit: r220450 - projects/stress2/lib

Peter Holm pho at FreeBSD.org
Fri Apr 8 12:49:56 UTC 2011


Author: pho
Date: Fri Apr  8 12:49:56 2011
New Revision: 220450
URL: http://svn.freebsd.org/changeset/base/220450

Log:
  arc4random(3) preserves state across fork(2), so a stir is needed.
  While here mark unused arguments.

Modified:
  projects/stress2/lib/main.c

Modified: projects/stress2/lib/main.c
==============================================================================
--- projects/stress2/lib/main.c	Fri Apr  8 12:46:47 2011	(r220449)
+++ projects/stress2/lib/main.c	Fri Apr  8 12:49:56 2011	(r220450)
@@ -52,7 +52,7 @@ char *home;
 static	pid_t *r;
 
 void
-handler(int i)
+handler(int i __unused)
 {
 	int j;
 
@@ -77,14 +77,14 @@ handler(int i)
 }
 
 void
-run_test_handler(int i)
+run_test_handler(int i __unused)
 {
 
 	done_testing = 1;
 }
 
 void
-exit_handler(int i)
+exit_handler(int i __unused)
 {
 
 	exit(1);
@@ -106,6 +106,7 @@ run_tests(int i)
 	signal(SIGHUP, run_test_handler);
 	signal(SIGINT, exit_handler);
 	atexit(callcleanup);
+	arc4random_stir();
 	setup(i);
 	if ((strcmp(getprogname(), "run") != 0) && (op->nodelay == 0))
 		sleep(random_int(1,10));


More information about the svn-src-projects mailing list