From: Hou Tao Date: Tue, 12 Jun 2018 12:43:30 +0000 (+0800) Subject: ltp/fsx: output the seed value after logid is initialized X-Git-Tag: v2022.05.01~1494 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9618c0adca1a246d75d780cce5cd8cd56d0b3d7c;p=users%2Fhch%2Fxfstests-dev.git ltp/fsx: output the seed value after logid is initialized 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/ltp/fsx.c b/ltp/fsx.c index ac9e92918..b0157ba35 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -2036,8 +2036,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; @@ -2091,6 +2089,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) {