summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
authorDavidlohr Bueso2010-11-16 14:47:35 +0100
committerKarel Zak2010-11-23 21:06:49 +0100
commit8abcf2900297c6d53ead867c42f7c1688e8d52ca (patch)
tree77e2d666cd76d9d4c37e1c1864415c1e52d37926 /login-utils
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 'login-utils')
-rw-r--r--login-utils/agetty.c2
-rw-r--r--login-utils/checktty.c2
-rw-r--r--login-utils/chfn.c2
-rw-r--r--login-utils/login.c2
-rw-r--r--login-utils/shutdown.c2
-rw-r--r--login-utils/simpleinit.c2
-rw-r--r--login-utils/vipw.c2
-rw-r--r--login-utils/wall.c2
8 files changed, 8 insertions, 8 deletions
diff --git a/login-utils/agetty.c b/login-utils/agetty.c
index f048c3e48..b1cfa5a53 100644
--- a/login-utils/agetty.c
+++ b/login-utils/agetty.c
@@ -32,7 +32,7 @@
#include <sys/socket.h>
#include <netdb.h>
-#include "xstrncpy.h"
+#include "strutils.h"
#include "nls.h"
#include "pathnames.h"
diff --git a/login-utils/checktty.c b/login-utils/checktty.c
index c28ee833d..92bebfb73 100644
--- a/login-utils/checktty.c
+++ b/login-utils/checktty.c
@@ -31,7 +31,7 @@
#include "pathnames.h"
#include "login.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#ifndef TTY_MAJOR
#define TTY_MAJOR 4
diff --git a/login-utils/chfn.c b/login-utils/chfn.c
index 691c4f6f5..ef0a746d5 100644
--- a/login-utils/chfn.c
+++ b/login-utils/chfn.c
@@ -36,7 +36,7 @@
#include "my_crypt.h"
#include "islocal.h"
#include "setpwnam.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#include "nls.h"
#include "env.h"
diff --git a/login-utils/login.c b/login-utils/login.c
index 1550388c4..68eb84bc1 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -113,7 +113,7 @@
#include "pathnames.h"
#include "my_crypt.h"
#include "login.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#include "nls.h"
diff --git a/login-utils/shutdown.c b/login-utils/shutdown.c
index 0078df2d6..172113c76 100644
--- a/login-utils/shutdown.c
+++ b/login-utils/shutdown.c
@@ -74,7 +74,7 @@
#include <sys/utsname.h>
#include "linux_reboot.h"
#include "pathnames.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#include "nls.h"
#include "usleep.h"
diff --git a/login-utils/simpleinit.c b/login-utils/simpleinit.c
index 8cff848cf..9277a3cc4 100644
--- a/login-utils/simpleinit.c
+++ b/login-utils/simpleinit.c
@@ -45,7 +45,7 @@
#include "my_crypt.h"
#include "pathnames.h"
#include "linux_reboot.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#include "nls.h"
#include "simpleinit.h"
diff --git a/login-utils/vipw.c b/login-utils/vipw.c
index b3972f3b3..e7247e42c 100644
--- a/login-utils/vipw.c
+++ b/login-utils/vipw.c
@@ -64,7 +64,7 @@ static char version_string[] = "vipw 1.4";
#include <unistd.h>
#include "setpwnam.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#include "nls.h"
#ifdef HAVE_LIBSELINUX
diff --git a/login-utils/wall.c b/login-utils/wall.c
index 7b5f6718f..38c544266 100644
--- a/login-utils/wall.c
+++ b/login-utils/wall.c
@@ -58,7 +58,7 @@
#include <utmp.h>
#include "nls.h"
-#include "xstrncpy.h"
+#include "strutils.h"
#include "ttymsg.h"
#include "pathnames.h"
#include "carefulputc.h"