[PATCH] rt-tests: oslat: print version string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During the streamlining of the command line options something went awry
with the version. The author of oslat wishes to always print the version
string. This allows us to just exit in the case of -v

Fixes e411219d27b1

Reported-by: Pradipta Kumar Sahoo <psahoo@xxxxxxxxxx>
Reported-by: Reported-by: Peter Xu <peterx@xxxxxxxxxx>

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
 src/oslat/oslat.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index 5b7e0d5b5d5c..7826c277f26d 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -512,7 +512,6 @@ static void handle_alarm(int code)
 
 static void usage(int error)
 {
-	printf("oslat V %1.2f\n", VERSION);
 	printf("Usage:\n"
 	       "oslat <options>\n\n"
 	       "This is an OS latency detector by running busy loops on specified cores.\n"
@@ -657,8 +656,8 @@ static void parse_options(int argc, char *argv[])
 			break;
 		case 'v':
 			/*
-			 * Because we always dump the version even before parsing options,
-			 * what we need to do is to quit..
+			 * We always print the version before parsing options
+			 * so just exit
 			 */
 			exit(0);
 			break;
@@ -736,7 +735,7 @@ int main(int argc, char *argv[])
 	g.workload_mem_size = WORKLOAD_MEM_SIZE;
 	/* Run the main thread on cpu0 by default */
 	g.cpu_main_thread = 0;
-
+	printf("oslat V %1.2f\n", VERSION);
 	parse_options(argc, argv);
 
 	TEST(mlockall(MCL_CURRENT | MCL_FUTURE) == 0);
-- 
2.26.2




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux