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 --- misc-utils/Makefile.am | 4 ++-- misc-utils/blkid.c | 2 +- misc-utils/wipefs.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'misc-utils') diff --git a/misc-utils/Makefile.am b/misc-utils/Makefile.am index aed8bac8..76b69fa4 100644 --- a/misc-utils/Makefile.am +++ b/misc-utils/Makefile.am @@ -37,12 +37,12 @@ if BUILD_LIBBLKID sbin_PROGRAMS += blkid findfs wipefs dist_man_MANS += blkid.8 findfs.8 wipefs.8 blkid_SOURCES = blkid.c $(top_srcdir)/lib/ismounted.c \ - $(top_srcdir)/lib/strtosize.c + $(top_srcdir)/lib/strutils.c blkid_LDADD = $(ul_libblkid_la) blkid_CFLAGS = $(AM_CFLAGS) -I$(ul_libblkid_incdir) findfs_LDADD = $(ul_libblkid_la) findfs_CFLAGS = $(AM_CFLAGS) -I$(ul_libblkid_incdir) -wipefs_SOURCES = wipefs.c $(top_srcdir)/lib/strtosize.c +wipefs_SOURCES = wipefs.c $(top_srcdir)/lib/strutils.c wipefs_LDADD = $(ul_libblkid_la) wipefs_CFLAGS = $(AM_CFLAGS) -I$(ul_libblkid_incdir) if HAVE_STATIC_BLKID diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c index f94df06a..2f7860fd 100644 --- a/misc-utils/blkid.c +++ b/misc-utils/blkid.c @@ -41,7 +41,7 @@ extern int optind; #include #include "ismounted.h" -#include "strtosize.h" +#include "strutils.h" const char *progname = "blkid"; diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index dbfabc4a..2f223f0c 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -35,7 +35,7 @@ #include "nls.h" #include "xalloc.h" -#include "strtosize.h" +#include "strutils.h" struct wipe_desc { loff_t offset; /* magic string offset */ -- cgit v1.2.3