diff options
author | Davidlohr Bueso | 2010-11-16 14:47:35 +0100 |
---|---|---|
committer | Karel Zak | 2010-11-23 21:06:49 +0100 |
commit | 8abcf2900297c6d53ead867c42f7c1688e8d52ca (patch) | |
tree | 77e2d666cd76d9d4c37e1c1864415c1e52d37926 /schedutils/chrt.c | |
parent | libblkid: cache is incorrectly revalidated (diff) | |
download | kernel-qcow2-util-linux-8abcf2900297c6d53ead867c42f7c1688e8d52ca.tar.gz kernel-qcow2-util-linux-8abcf2900297c6d53ead867c42f7c1688e8d52ca.tar.xz kernel-qcow2-util-linux-8abcf2900297c6d53ead867c42f7c1688e8d52ca.zip |
lib: [strutils] general purpose string handling functions
This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)
A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Diffstat (limited to 'schedutils/chrt.c')
-rw-r--r-- | schedutils/chrt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 811eb200e..bd7070cca 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -32,7 +32,7 @@ #include "c.h" #include "nls.h" -#include "schedutils.h" +#include "strutils.h" /* the SCHED_BATCH is supported since Linux 2.6.16 * -- temporary workaround for people with old glibc headers @@ -240,7 +240,7 @@ int main(int argc, char *argv[]) break; case 'p': errno = 0; - pid = getnum(argv[argc - 1], _("failed to parse pid")); + pid = strtol_or_err(argv[argc - 1], _("failed to parse pid")); break; case 'r': policy = SCHED_RR; @@ -268,7 +268,7 @@ int main(int argc, char *argv[]) } errno = 0; - priority = getnum(argv[optind], _("failed to parse priority")); + priority = strtol_or_err(argv[optind], _("failed to parse priority")); #ifdef SCHED_RESET_ON_FORK /* sanity check */ |