summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2011-02-22 01:31:52 -0500
committerDave Jones <davej@redhat.com>2011-02-22 01:31:52 -0500
commitb9889927b8368129c51a3f919fca09c146ef9931 (patch)
tree49fe725141f407db78e063dedeb1dc6926705fa1
parentf37ccc1f1028ecf9822d57f3a7143e8963aa8a5e (diff)
exit when trying to use something that needs root.
-rw-r--r--x86info.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/x86info.c b/x86info.c
index 9c0ca27..0ba96c3 100644
--- a/x86info.c
+++ b/x86info.c
@@ -333,8 +333,10 @@ int main (int argc, char **argv)
if (getuid() != 0)
user_is_root=0;
- if (need_root && !user_is_root)
+ if (need_root && !user_is_root) {
printf("Need to be root to use specified options.\n");
+ exit(EXIT_FAILURE);
+ }
nrCPUs = sysconf(_SC_NPROCESSORS_ONLN);