summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2009-06-11 16:29:13 -0500
committerDavid Smith <dsmith@redhat.com>2009-06-11 16:29:13 -0500
commit5dce84d4fe74644ef76004ff0402510b289a2778 (patch)
tree613deb4149bdfee88f48cc28d7a4b124946e5777 /main.cxx
parent43229357282fd51eb1a3c7742932068873c27270 (diff)
parent749269040630f0f250f431a258e7967f54dc9a5c (diff)
downloadsystemtap-steved-5dce84d4fe74644ef76004ff0402510b289a2778.tar.gz
systemtap-steved-5dce84d4fe74644ef76004ff0402510b289a2778.tar.xz
systemtap-steved-5dce84d4fe74644ef76004ff0402510b289a2778.zip
Merge commit 'origin/master' into pr7043
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/main.cxx b/main.cxx
index 1ac5dd5a..9dc658ff 100644
--- a/main.cxx
+++ b/main.cxx
@@ -20,6 +20,7 @@
#include "util.h"
#include "coveragedb.h"
#include "git_version.h"
+#include "rpm_finder.h"
#include <iostream>
#include <fstream>
@@ -469,6 +470,7 @@ main (int argc, char * const argv [])
while (true)
{
int long_opt;
+ char * num_endptr;
#define LONG_OPT_KELF 1
#define LONG_OPT_KMAP 2
#define LONG_OPT_IGNORE_VMLINUX 3
@@ -518,8 +520,8 @@ main (int argc, char * const argv [])
cerr << "Listing (-l) mode implies pass 2." << endl;
usage (s, 1);
}
- s.last_pass = atoi (optarg);
- if (s.last_pass < 1 || s.last_pass > 5)
+ s.last_pass = (int)strtoul(optarg, &num_endptr, 10);
+ if (*num_endptr != '\0' || s.last_pass < 1 || s.last_pass > 5)
{
cerr << "Invalid pass number (should be 1-5)." << endl;
usage (s, 1);
@@ -625,8 +627,8 @@ main (int argc, char * const argv [])
break;
case 's':
- s.buffer_size = atoi (optarg);
- if (s.buffer_size < 1 || s.buffer_size > 4095)
+ s.buffer_size = (int) strtoul (optarg, &num_endptr, 10);
+ if (*num_endptr != '\0' || s.buffer_size < 1 || s.buffer_size > 4095)
{
cerr << "Invalid buffer size (should be 1-4095)." << endl;
usage (s, 1);
@@ -638,7 +640,12 @@ main (int argc, char * const argv [])
break;
case 'x':
- s.target_pid = atoi(optarg);
+ s.target_pid = (int) strtoul(optarg, &num_endptr, 10);
+ if (*num_endptr != '\0')
+ {
+ cerr << "Invalid target process ID number." << endl;
+ usage (s, 1);
+ }
break;
case 'D':
@@ -1063,6 +1070,9 @@ main (int argc, char * const argv [])
}
}
+ /* Print out list of missing files */
+ missing_rpm_list_print(s);
+
if (rc || s.listing_mode || s.last_pass == 2 || pending_interrupts) goto cleanup;
// PASS 3: TRANSLATION