move utmp.h include to libbb.h
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 25 Jan 2011 22:21:46 +0000 (23:21 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 25 Jan 2011 22:21:46 +0000 (23:21 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
16 files changed:
Config.in
coreutils/who.c
include/libbb.h
init/halt.c
init/init.c
libbb/messages.c
libbb/utmp.c
loginutils/adduser.c
loginutils/getty.c
loginutils/login.c
miscutils/last.c
miscutils/last_fancy.c
miscutils/runlevel.c
miscutils/wall.c
networking/telnetd.c
shell/ash.c

index 1109b10163f679859e2dc64f1601ed9640126bc6..0ae48e9fe39adf8aecaf7684a8abeb0bce3a6561 100644 (file)
--- a/Config.in
+++ b/Config.in
@@ -284,10 +284,19 @@ config FEATURE_CLEAN_UP
          Don't enable this unless you have a really good reason to clean
          things up manually.
 
+config FEATURE_UTMP
+       bool "Support utmp file"
+       default y
+       help
+         The file /var/run/utmp is used to track who is currently logged in.
+         With this option on, certain applets (getty, login, telnetd etc)
+         will create and delete entries there.
+         "who" applet requires this option.
+
 config FEATURE_WTMP
        bool "Support wtmp file"
        default y
-       select FEATURE_UTMP
+       depends on FEATURE_UTMP
        help
          The file /var/run/wtmp is used to track when users have logged into
          and logged out of the system.
@@ -295,15 +304,6 @@ config FEATURE_WTMP
          will append new entries there.
          "last" applet requires this option.
 
-config FEATURE_UTMP
-       bool "Support utmp file"
-       default y
-       help
-         The file /var/run/utmp is used to track who is currently logged in.
-         With this option on, certain applets (getty, login, telnetd etc)
-         will create and delete entries there.
-         "who" applet requires this option.
-
 config FEATURE_PIDFILE
        bool "Support writing pidfiles"
        default y
index 8384d95349d574b36967c4f9fc30d80e825bdfe9..ab1e30fc8d82632a56f392ff48e0188444d676cc 100644 (file)
@@ -19,7 +19,6 @@
 /* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'.  */
 
 #include "libbb.h"
-#include <utmp.h>
 
 static void idle_string(char *str6, time_t t)
 {
index 32e25a8d454123ef7ecac5cb4823e5c87b102fbe..182b479884138b0b22c79ef360af97b8cf0bb5b4 100644 (file)
@@ -50,6 +50,9 @@
 # include <selinux/flask.h>
 # include <selinux/av_permissions.h>
 #endif
+#if ENABLE_FEATURE_UTMP
+# include <utmp.h>
+#endif
 #if ENABLE_LOCALE_SUPPORT
 # include <locale.h>
 #else
index f853ba4a13e20521745c8d21ee711e3c4dcc5d69..a84a727477e50dc22d01e19eaa7f1aa551d50b83 100644 (file)
@@ -74,7 +74,6 @@
 
 #if ENABLE_FEATURE_WTMP
 #include <sys/utsname.h>
-#include <utmp.h>
 
 static void write_wtmp(void)
 {
index d8e1807462c051254571417bdbe915a453722a02..586e34a18eb448d4b6cef4789e7614ee88138ce6 100644 (file)
 #ifdef __linux__
 #include <linux/vt.h>
 #endif
-#if ENABLE_FEATURE_UTMP
-# include <utmp.h> /* DEAD_PROCESS */
-#endif
 #include "reboot.h" /* reboot() constants */
 
 /* Used only for sanitizing purposes in set_sane_term() below. On systems where
index 66e466ffa4bcb866d3c3b2fece74db8b9e4b730e..2acbc3bcab9df94c9f3f70b0872b7c4e9ecc591a 100644 (file)
@@ -48,15 +48,16 @@ const int const_int_1 = 1;
  * and it will end up in bss */
 const int const_int_0 = 0;
 
-#include <utmp.h>
+#if ENABLE_FEATURE_WTMP
 /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */
 const char bb_path_wtmp_file[] ALIGN1 =
-#if defined _PATH_WTMP
+# if defined _PATH_WTMP
        _PATH_WTMP;
-#elif defined WTMP_FILE
+# elif defined WTMP_FILE
        WTMP_FILE;
-#else
-#error unknown path to wtmp file
+# else
+#  error unknown path to wtmp file
+# endif
 #endif
 
 /* We use it for "global" data via *(struct global*)&bb_common_bufsiz1.
index 2bf9c11f243b92e426a7988187ce8d4c02d99b77..09443fb6c42b1b58232176ed3250e1a487f93d8c 100644 (file)
@@ -7,7 +7,6 @@
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 #include "libbb.h"
-#include <utmp.h>
 
 static void touch(const char *filename)
 {
index 1a9949e971563ea72c389e5836ebbfa306bf4177..d938b80f317e34e554491e2f16ef045aa595326a 100644 (file)
@@ -78,11 +78,11 @@ static void addgroup_wrapper(struct passwd *p, const char *group_name)
        free(cmd);
 }
 
-static void passwd_wrapper(const char *login) NORETURN;
+static void passwd_wrapper(const char *login_name) NORETURN;
 
-static void passwd_wrapper(const char *login)
+static void passwd_wrapper(const char *login_name)
 {
-       BB_EXECLP("passwd", "passwd", login, NULL);
+       BB_EXECLP("passwd", "passwd", login_name, NULL);
        bb_error_msg_and_die("can't execute passwd, you must set password manually");
 }
 
index becff5c78d4417294d16e72e9dc48c16158853c5..b71d68a1ff8b488b44b35732a4ca78e2f7057431 100644 (file)
@@ -24,9 +24,6 @@
 
 #include "libbb.h"
 #include <syslog.h>
-#if ENABLE_FEATURE_UTMP
-# include <utmp.h> /* LOGIN_PROCESS */
-#endif
 #ifndef IUCLC
 # define IUCLC 0
 #endif
index c285b45a1279b5861fbd6fee9913d3979360ee35..952b3aadd2c460db3baa908c394320724bf25532 100644 (file)
@@ -4,9 +4,6 @@
  */
 #include "libbb.h"
 #include <syslog.h>
-#if ENABLE_FEATURE_UTMP
-# include <utmp.h> /* USER_PROCESS */
-#endif
 #include <sys/resource.h>
 
 #if ENABLE_SELINUX
index fec5b70a8c4c087422269633e042bd5e4b975ca2..12457b1579623272895f43712d1d2deb4de9045b 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include "libbb.h"
-#include <utmp.h>
 
 /* NB: ut_name and ut_user are the same field, use only one name (ut_user)
  * to reduce confusion */
index 7e69fc2811ccb0b3b3d9d920a128503ace3f096b..7e61b7691e38050e2869554786096e2cc1c63b6a 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include "libbb.h"
-#include <utmp.h>
 
 /* NB: ut_name and ut_user are the same field, use only one name (ut_user)
  * to reduce confusion */
index 363e45049274ff975e50496d6fa68ef6304874a1..7024361e780c97d4a0b9dc6df4319cccea765293 100644 (file)
@@ -12,7 +12,6 @@
  * initially busyboxified by Bernhard Reutner-Fischer
  */
 #include "libbb.h"
-#include <utmp.h>
 
 int runlevel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int runlevel_main(int argc UNUSED_PARAM, char **argv)
index eecfc166bc608a196a9cacd4b5ffd94909068afe..0a2b89e5ece6d847a891b98d21b2b33cccce83fd 100644 (file)
@@ -7,7 +7,6 @@
  */
 
 #include "libbb.h"
-#include <utmp.h>
 
 int wall_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int wall_main(int argc UNUSED_PARAM, char **argv)
index 07c6a6a73861441790067c771b745105e538b6eb..eec4417ca96aaceec0619b0eee9771efede518c0 100644 (file)
 #endif
 #include <arpa/telnet.h>
 
-#if ENABLE_FEATURE_UTMP
-# include <utmp.h> /* LOGIN_PROCESS */
-#endif
-
 
 struct tsession {
        struct tsession *next;
index 298ba35586f9a277555457eded1bf0ead5d74b8d..0bcbf9028d2d2dee1b38889b4e408b3b70a4324e 100644 (file)
@@ -4944,6 +4944,8 @@ stoppedjobs(void)
  * Code for dealing with input/output redirection.
  */
 
+#undef EMPTY
+#undef CLOSED
 #define EMPTY -2                /* marks an unused slot in redirtab */
 #define CLOSED -3               /* marks a slot of previously-closed fd */