diff mbox

ltp/fsx: output the seed value after logid is initialized

Message ID 20180612124330.47796-1-houtao1@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hou Tao June 12, 2018, 12:43 p.m. UTC
When running multiple fsx processes simultaneously (e.g. generic/455),
it is difficult to tell the seed value for one fsx process if the
seed value is needed to reproduce a log-replay failure.

Fix it by outputting the seed value after logid is initialized.

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 ltp/fsx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/ltp/fsx.c b/ltp/fsx.c
index 65f1a3bb..f8cedb24 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -2070,8 +2070,6 @@  main(int argc, char **argv)
 				seed = time(0) % 10000;
 				seed += (int)getpid();
 			}
-			if (!quiet)
-				prt("Seed set to %d\n", seed);
 			if (seed < 0)
 				usage();
 			break;
@@ -2138,6 +2136,8 @@  main(int argc, char **argv)
 	signal(SIGUSR1,	cleanup);
 	signal(SIGUSR2,	cleanup);
 
+	if (!quiet && seed)
+		prt("Seed set to %d\n", seed);
 	srandom(seed);
 	fd = open(fname, o_flags, 0666);
 	if (fd < 0) {