diff options
author | Dave Jones <davej@redhat.com> | 2011-02-22 01:31:52 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-02-22 01:31:52 -0500 |
commit | b9889927b8368129c51a3f919fca09c146ef9931 (patch) | |
tree | 49fe725141f407db78e063dedeb1dc6926705fa1 | |
parent | f37ccc1f1028ecf9822d57f3a7143e8963aa8a5e (diff) |
exit when trying to use something that needs root.
-rw-r--r-- | x86info.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |