X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fdhrystone%2F0001-cmdline-nruns.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fdhrystone%2F0001-cmdline-nruns.patch;h=1164610cca1973f39a09198ceefad691b5ef136e;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/dhrystone/0001-cmdline-nruns.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/dhrystone/0001-cmdline-nruns.patch new file mode 100644 index 0000000..1164610 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/dhrystone/0001-cmdline-nruns.patch @@ -0,0 +1,53 @@ +let people specify the number of runs on the command line + +Patch by Vivi Li + +--- a/dhry_1.c ++++ b/dhry_1.c +@@ -66,7 +70,7 @@ + /* end of variables for time measurement */ + + +-main () ++main(int argc, char *argv[]) + /*****/ + + /* main program, corresponds to procedures */ +@@ -101,6 +105,13 @@ + /* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */ + /* overflow may occur for this array element. */ + ++ Number_Of_Runs = 0; ++ if ( argc == 2 ) { ++ if (atoi(argv[1]) > 0) { ++ Number_Of_Runs = atoi(argv[1]); ++ } ++ } ++ + printf ("\n"); + printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n"); + printf ("\n"); +@@ -114,13 +125,17 @@ + printf ("Program compiled without 'register' attribute\n"); + printf ("\n"); + } +- printf ("Please give the number of runs through the benchmark: "); +- { +- int n; +- scanf ("%d", &n); +- Number_Of_Runs = n; ++ ++ if (!Number_Of_Runs) { ++ printf ("Please give the number of runs through the benchmark: "); ++ fflush (stdout); ++ { ++ int n; ++ scanf ("%d", &n); ++ Number_Of_Runs = n; ++ } ++ printf ("\n"); + } +- printf ("\n"); + + printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs); +