From 8abcf2900297c6d53ead867c42f7c1688e8d52ca Mon Sep 17 00:00:00 2001 From: Davidlohr Bueso Date: Tue, 16 Nov 2010 10:47:35 -0300 Subject: 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 --- schedutils/taskset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'schedutils/taskset.c') diff --git a/schedutils/taskset.c b/schedutils/taskset.c index 201fc1589..5a7557c3a 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -32,7 +32,7 @@ #include "cpuset.h" #include "nls.h" -#include "schedutils.h" +#include "strutils.h" static void __attribute__((__noreturn__)) usage(FILE *out) { @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) while ((opt = getopt_long(argc, argv, "+pchV", longopts, NULL)) != -1) { switch (opt) { case 'p': - pid = getnum(argv[argc - 1], _("failed to parse pid")); + pid = strtol_or_err(argv[argc - 1], _("failed to parse pid")); break; case 'c': c_opt = 1; -- cgit v1.2.3-55-g7522