On Tuesday 16 October 2012 23:13:36 Wanlong Gao wrote:
> --- a/tools/apicmds/ltpapicmd.c
> +++ b/tools/apicmds/ltpapicmd.c
> @@ -266,6 +266,12 @@ int main(int argc, char *argv[])
> else if (exit_value > 0)
> exit_value = 2;
> exit(exit_value);
> + } else if (strcmp(cmd_name, "tst_ncpus") == 0) {
> + long exit_ncpus = tst_ncpus();
> + exit(exit_ncpus);
> + } else if (strcmp(cmd_name, "tst_ncpus_max") == 0) {
> + long exit_ncpus_max = tst_ncpus_max();
> + exit(exit_ncpus_max);
> }
i'm afraid exit() won't work. the value is anded with 0xff which means if you
have a system with 4096 cpus, these will exit(0) and obviously that isn't what
you want :). plus, extracting the value from the exit status is not normal
behavior in the shell scripting world.
simply write it to stdout instead:
printf("%li\n", tst_ncpus());
-mike
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
