diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
commit | 71cd8e3a743046573744123777061b64881bf372 (patch) | |
tree | 82522befe647f4fff186a5630cad0cad33f8ef53 /src/nproc.c | |
parent | c18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff) | |
download | coreutils-upstream.tar.gz |
Imported Upstream version 8.24upstream/8.24upstream
Diffstat (limited to 'src/nproc.c')
-rw-r--r-- | src/nproc.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/nproc.c b/src/nproc.c index 9bfc8b39..63c78cd4 100644 --- a/src/nproc.c +++ b/src/nproc.c @@ -1,5 +1,5 @@ /* nproc - print the number of processors. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include "error.h" #include "nproc.h" #include "quote.h" -#include "xstrtol.h" +#include "xdectoint.h" /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "nproc" @@ -67,7 +67,7 @@ which may be less than the number of online processors\n\ fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - emit_ancillary_info (); + emit_ancillary_info (PROGRAM_NAME); } exit (status); } @@ -102,11 +102,7 @@ main (int argc, char **argv) break; case IGNORE_OPTION: - if (xstrtoul (optarg, NULL, 10, &ignore, "") != LONGINT_OK) - { - error (0, 0, _("%s: invalid number to ignore"), optarg); - usage (EXIT_FAILURE); - } + ignore = xdectoumax (optarg, 0, ULONG_MAX, "", _("invalid number"),0); break; default: @@ -129,5 +125,5 @@ main (int argc, char **argv) printf ("%lu\n", nproc); - exit (EXIT_SUCCESS); + return EXIT_SUCCESS; } |