Need to use optind and optind+1 to get the context ID and event-set ID,
instead of assuming they are in the 1st and 2nd arguments.

Signed-off-by: Kevin Corry <[EMAIL PROTECTED]>

--- libpfm-a/examples/pfmsetup.c        24 Apr 2007 04:46:33 -0000
+++ libpfm-b/examples/pfmsetup.c        26 Apr 2007 19:27:12 -0000
@@ -1357,8 +1357,8 @@
                return EINVAL;
        }
 
-       ctx_id = strtoul(argv[1], NULL, 0);
-       event_set_id = strtoul(argv[2], NULL, 0);
+       ctx_id = strtoul(argv[optind], NULL, 0);
+       event_set_id = strtoul(argv[optind+1], NULL, 0);
 
        if (ctx_id <= 0 || event_set_id < 0) {
                LOG_ERROR("context ID and event-set ID must be "
_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to