aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-01-25 23:21:46 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-01-25 23:21:46 +0100
commit8d0e0cdadf726beab28ccdc7d69738c1534e1f74 (patch)
tree73eec58affb5ac0b6d8e97fb36e9f0beb11da00d
parent9aa599dc9dc076f6fa6e4312e4750a703cf16450 (diff)
downloadbusybox-w32-8d0e0cdadf726beab28ccdc7d69738c1534e1f74.tar.gz
busybox-w32-8d0e0cdadf726beab28ccdc7d69738c1534e1f74.tar.bz2
busybox-w32-8d0e0cdadf726beab28ccdc7d69738c1534e1f74.zip
move utmp.h include to libbb.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Config.in20
-rw-r--r--coreutils/who.c1
-rw-r--r--include/libbb.h3
-rw-r--r--init/halt.c1
-rw-r--r--init/init.c3
-rw-r--r--libbb/messages.c11
-rw-r--r--libbb/utmp.c1
-rw-r--r--loginutils/adduser.c6
-rw-r--r--loginutils/getty.c3
-rw-r--r--loginutils/login.c3
-rw-r--r--miscutils/last.c1
-rw-r--r--miscutils/last_fancy.c1
-rw-r--r--miscutils/runlevel.c1
-rw-r--r--miscutils/wall.c1
-rw-r--r--networking/telnetd.c4
-rw-r--r--shell/ash.c2
16 files changed, 24 insertions, 38 deletions
diff --git a/Config.in b/Config.in
index 1109b1016..0ae48e9fe 100644
--- a/Config.in
+++ b/Config.in
@@ -284,10 +284,19 @@ config FEATURE_CLEAN_UP
284 Don't enable this unless you have a really good reason to clean 284 Don't enable this unless you have a really good reason to clean
285 things up manually. 285 things up manually.
286 286
287config FEATURE_UTMP
288 bool "Support utmp file"
289 default y
290 help
291 The file /var/run/utmp is used to track who is currently logged in.
292 With this option on, certain applets (getty, login, telnetd etc)
293 will create and delete entries there.
294 "who" applet requires this option.
295
287config FEATURE_WTMP 296config FEATURE_WTMP
288 bool "Support wtmp file" 297 bool "Support wtmp file"
289 default y 298 default y
290 select FEATURE_UTMP 299 depends on FEATURE_UTMP
291 help 300 help
292 The file /var/run/wtmp is used to track when users have logged into 301 The file /var/run/wtmp is used to track when users have logged into
293 and logged out of the system. 302 and logged out of the system.
@@ -295,15 +304,6 @@ config FEATURE_WTMP
295 will append new entries there. 304 will append new entries there.
296 "last" applet requires this option. 305 "last" applet requires this option.
297 306
298config FEATURE_UTMP
299 bool "Support utmp file"
300 default y
301 help
302 The file /var/run/utmp is used to track who is currently logged in.
303 With this option on, certain applets (getty, login, telnetd etc)
304 will create and delete entries there.
305 "who" applet requires this option.
306
307config FEATURE_PIDFILE 307config FEATURE_PIDFILE
308 bool "Support writing pidfiles" 308 bool "Support writing pidfiles"
309 default y 309 default y
diff --git a/coreutils/who.c b/coreutils/who.c
index 8384d9534..ab1e30fc8 100644
--- a/coreutils/who.c
+++ b/coreutils/who.c
@@ -19,7 +19,6 @@
19/* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */ 19/* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */
20 20
21#include "libbb.h" 21#include "libbb.h"
22#include <utmp.h>
23 22
24static void idle_string(char *str6, time_t t) 23static void idle_string(char *str6, time_t t)
25{ 24{
diff --git a/include/libbb.h b/include/libbb.h
index 32e25a8d4..182b47988 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -50,6 +50,9 @@
50# include <selinux/flask.h> 50# include <selinux/flask.h>
51# include <selinux/av_permissions.h> 51# include <selinux/av_permissions.h>
52#endif 52#endif
53#if ENABLE_FEATURE_UTMP
54# include <utmp.h>
55#endif
53#if ENABLE_LOCALE_SUPPORT 56#if ENABLE_LOCALE_SUPPORT
54# include <locale.h> 57# include <locale.h>
55#else 58#else
diff --git a/init/halt.c b/init/halt.c
index f853ba4a1..a84a72747 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -74,7 +74,6 @@
74 74
75#if ENABLE_FEATURE_WTMP 75#if ENABLE_FEATURE_WTMP
76#include <sys/utsname.h> 76#include <sys/utsname.h>
77#include <utmp.h>
78 77
79static void write_wtmp(void) 78static void write_wtmp(void)
80{ 79{
diff --git a/init/init.c b/init/init.c
index d8e180746..586e34a18 100644
--- a/init/init.c
+++ b/init/init.c
@@ -115,9 +115,6 @@
115#ifdef __linux__ 115#ifdef __linux__
116#include <linux/vt.h> 116#include <linux/vt.h>
117#endif 117#endif
118#if ENABLE_FEATURE_UTMP
119# include <utmp.h> /* DEAD_PROCESS */
120#endif
121#include "reboot.h" /* reboot() constants */ 118#include "reboot.h" /* reboot() constants */
122 119
123/* Used only for sanitizing purposes in set_sane_term() below. On systems where 120/* Used only for sanitizing purposes in set_sane_term() below. On systems where
diff --git a/libbb/messages.c b/libbb/messages.c
index 66e466ffa..2acbc3bca 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -48,15 +48,16 @@ const int const_int_1 = 1;
48 * and it will end up in bss */ 48 * and it will end up in bss */
49const int const_int_0 = 0; 49const int const_int_0 = 0;
50 50
51#include <utmp.h> 51#if ENABLE_FEATURE_WTMP
52/* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */ 52/* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */
53const char bb_path_wtmp_file[] ALIGN1 = 53const char bb_path_wtmp_file[] ALIGN1 =
54#if defined _PATH_WTMP 54# if defined _PATH_WTMP
55 _PATH_WTMP; 55 _PATH_WTMP;
56#elif defined WTMP_FILE 56# elif defined WTMP_FILE
57 WTMP_FILE; 57 WTMP_FILE;
58#else 58# else
59#error unknown path to wtmp file 59# error unknown path to wtmp file
60# endif
60#endif 61#endif
61 62
62/* We use it for "global" data via *(struct global*)&bb_common_bufsiz1. 63/* We use it for "global" data via *(struct global*)&bb_common_bufsiz1.
diff --git a/libbb/utmp.c b/libbb/utmp.c
index 2bf9c11f2..09443fb6c 100644
--- a/libbb/utmp.c
+++ b/libbb/utmp.c
@@ -7,7 +7,6 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10#include <utmp.h>
11 10
12static void touch(const char *filename) 11static void touch(const char *filename)
13{ 12{
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 1a9949e97..d938b80f3 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -78,11 +78,11 @@ static void addgroup_wrapper(struct passwd *p, const char *group_name)
78 free(cmd); 78 free(cmd);
79} 79}
80 80
81static void passwd_wrapper(const char *login) NORETURN; 81static void passwd_wrapper(const char *login_name) NORETURN;
82 82
83static void passwd_wrapper(const char *login) 83static void passwd_wrapper(const char *login_name)
84{ 84{
85 BB_EXECLP("passwd", "passwd", login, NULL); 85 BB_EXECLP("passwd", "passwd", login_name, NULL);
86 bb_error_msg_and_die("can't execute passwd, you must set password manually"); 86 bb_error_msg_and_die("can't execute passwd, you must set password manually");
87} 87}
88 88
diff --git a/loginutils/getty.c b/loginutils/getty.c
index becff5c78..b71d68a1f 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -24,9 +24,6 @@
24 24
25#include "libbb.h" 25#include "libbb.h"
26#include <syslog.h> 26#include <syslog.h>
27#if ENABLE_FEATURE_UTMP
28# include <utmp.h> /* LOGIN_PROCESS */
29#endif
30#ifndef IUCLC 27#ifndef IUCLC
31# define IUCLC 0 28# define IUCLC 0
32#endif 29#endif
diff --git a/loginutils/login.c b/loginutils/login.c
index c285b45a1..952b3aadd 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -4,9 +4,6 @@
4 */ 4 */
5#include "libbb.h" 5#include "libbb.h"
6#include <syslog.h> 6#include <syslog.h>
7#if ENABLE_FEATURE_UTMP
8# include <utmp.h> /* USER_PROCESS */
9#endif
10#include <sys/resource.h> 7#include <sys/resource.h>
11 8
12#if ENABLE_SELINUX 9#if ENABLE_SELINUX
diff --git a/miscutils/last.c b/miscutils/last.c
index fec5b70a8..12457b157 100644
--- a/miscutils/last.c
+++ b/miscutils/last.c
@@ -8,7 +8,6 @@
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
11#include <utmp.h>
12 11
13/* NB: ut_name and ut_user are the same field, use only one name (ut_user) 12/* NB: ut_name and ut_user are the same field, use only one name (ut_user)
14 * to reduce confusion */ 13 * to reduce confusion */
diff --git a/miscutils/last_fancy.c b/miscutils/last_fancy.c
index 7e69fc281..7e61b7691 100644
--- a/miscutils/last_fancy.c
+++ b/miscutils/last_fancy.c
@@ -8,7 +8,6 @@
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
11#include <utmp.h>
12 11
13/* NB: ut_name and ut_user are the same field, use only one name (ut_user) 12/* NB: ut_name and ut_user are the same field, use only one name (ut_user)
14 * to reduce confusion */ 13 * to reduce confusion */
diff --git a/miscutils/runlevel.c b/miscutils/runlevel.c
index 363e45049..7024361e7 100644
--- a/miscutils/runlevel.c
+++ b/miscutils/runlevel.c
@@ -12,7 +12,6 @@
12 * initially busyboxified by Bernhard Reutner-Fischer 12 * initially busyboxified by Bernhard Reutner-Fischer
13 */ 13 */
14#include "libbb.h" 14#include "libbb.h"
15#include <utmp.h>
16 15
17int runlevel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16int runlevel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
18int runlevel_main(int argc UNUSED_PARAM, char **argv) 17int runlevel_main(int argc UNUSED_PARAM, char **argv)
diff --git a/miscutils/wall.c b/miscutils/wall.c
index eecfc166b..0a2b89e5e 100644
--- a/miscutils/wall.c
+++ b/miscutils/wall.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include "libbb.h" 9#include "libbb.h"
10#include <utmp.h>
11 10
12int wall_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 11int wall_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
13int wall_main(int argc UNUSED_PARAM, char **argv) 12int wall_main(int argc UNUSED_PARAM, char **argv)
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 07c6a6a73..eec4417ca 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -31,10 +31,6 @@
31#endif 31#endif
32#include <arpa/telnet.h> 32#include <arpa/telnet.h>
33 33
34#if ENABLE_FEATURE_UTMP
35# include <utmp.h> /* LOGIN_PROCESS */
36#endif
37
38 34
39struct tsession { 35struct tsession {
40 struct tsession *next; 36 struct tsession *next;
diff --git a/shell/ash.c b/shell/ash.c
index 298ba3558..0bcbf9028 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4944,6 +4944,8 @@ stoppedjobs(void)
4944 * Code for dealing with input/output redirection. 4944 * Code for dealing with input/output redirection.
4945 */ 4945 */
4946 4946
4947#undef EMPTY
4948#undef CLOSED
4947#define EMPTY -2 /* marks an unused slot in redirtab */ 4949#define EMPTY -2 /* marks an unused slot in redirtab */
4948#define CLOSED -3 /* marks a slot of previously-closed fd */ 4950#define CLOSED -3 /* marks a slot of previously-closed fd */
4949 4951