summaryrefslogtreecommitdiffstats
path: root/mount
diff options
context:
space:
mode:
authorDavidlohr Bueso2010-11-16 14:47:35 +0100
committerKarel Zak2010-11-23 21:06:49 +0100
commit8abcf2900297c6d53ead867c42f7c1688e8d52ca (patch)
tree77e2d666cd76d9d4c37e1c1864415c1e52d37926 /mount
parentlibblkid: cache is incorrectly revalidated (diff)
downloadkernel-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 'mount')
-rw-r--r--mount/Makefile.am6
-rw-r--r--mount/lomount.c4
-rw-r--r--mount/mount.c2
-rw-r--r--mount/umount.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/mount/Makefile.am b/mount/Makefile.am
index 235cceb06..36b06e327 100644
--- a/mount/Makefile.am
+++ b/mount/Makefile.am
@@ -28,12 +28,12 @@ cflags_common = $(AM_CFLAGS)
ldflags_static = -all-static
mount_SOURCES = mount.c $(srcs_mount) $(top_srcdir)/lib/setproctitle.c \
- $(top_srcdir)/lib/strtosize.c
+ $(top_srcdir)/lib/strutils.c
mount_CFLAGS = $(SUID_CFLAGS) $(cflags_common)
mount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
mount_LDADD = $(ldadd_common)
-umount_SOURCES = umount.c $(srcs_mount) $(top_srcdir)/lib/strtosize.c
+umount_SOURCES = umount.c $(srcs_mount) $(top_srcdir)/lib/strutils.c
umount_CFLAGS = $(SUID_CFLAGS) $(cflags_common)
umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
umount_LDADD = $(ldadd_common)
@@ -45,7 +45,7 @@ swapon_CFLAGS = $(cflags_common)
swapon_LDADD = $(ldadd_common)
losetup_SOURCES = lomount.c $(srcs_common) loop.h lomount.h \
- $(top_srcdir)/lib/strtosize.c
+ $(top_srcdir)/lib/strutils.c
losetup_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
mount_static_LDADD =
diff --git a/mount/lomount.c b/mount/lomount.c
index 03aae4b2a..d6556fc71 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -18,7 +18,7 @@
#include "loop.h"
#include "lomount.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#include "nls.h"
#include "sundries.h"
#include "xmalloc.h"
@@ -886,7 +886,7 @@ find_unused_loop_device (void) {
#include <getopt.h>
#include <stdarg.h>
-#include "strtosize.h"
+#include "strutils.h"
static void
usage(FILE *f) {
diff --git a/mount/mount.c b/mount/mount.c
index c0023f394..9faa6a5b6 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -41,7 +41,7 @@
#include "env.h"
#include "nls.h"
#include "blkdev.h"
-#include "strtosize.h"
+#include "strutils.h"
#define DO_PS_FIDDLING
diff --git a/mount/umount.c b/mount/umount.c
index b5ff8a177..6e24779b4 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -20,7 +20,7 @@
#include "fstab.h"
#include "env.h"
#include "nls.h"
-#include "strtosize.h"
+#include "strutils.h"
#if defined(MNT_FORCE)
/* Interesting ... it seems libc knows about MNT_FORCE and presumably