aboutsummaryrefslogtreecommitdiff
path: root/init/halt.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-02 23:03:46 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-02 23:03:46 +0200
commit86a7f18f211af1abda5c855d2674b0fcb53de524 (patch)
tree9fd1eadb83bf48b29e9468ea8ff0e43c0736c245 /init/halt.c
parent1186894f773e13ab9ca2b3e05a194e9b88796fbe (diff)
downloadbusybox-w32-86a7f18f211af1abda5c855d2674b0fcb53de524.tar.gz
busybox-w32-86a7f18f211af1abda5c855d2674b0fcb53de524.tar.bz2
busybox-w32-86a7f18f211af1abda5c855d2674b0fcb53de524.zip
*: Switch to POSIX utmpx API
UTMP is SVID legacy, UTMPX is mandated by POSIX. Glibc and uClibc have identical layout of UTMP and UTMPX, both of these libc treat _PATH_UTMPX as _PATH_UTMP so from a user-perspective nothing changes except the names of the API entrypoints. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'init/halt.c')
-rw-r--r--init/halt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/init/halt.c b/init/halt.c
index 7974adb17..ad12d9148 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -74,7 +74,7 @@
74 74
75static void write_wtmp(void) 75static void write_wtmp(void)
76{ 76{
77 struct utmp utmp; 77 struct utmpx utmp;
78 struct utsname uts; 78 struct utsname uts;
79 /* "man utmp" says wtmp file should *not* be created automagically */ 79 /* "man utmp" says wtmp file should *not* be created automagically */
80 /*if (access(bb_path_wtmp_file, R_OK|W_OK) == -1) { 80 /*if (access(bb_path_wtmp_file, R_OK|W_OK) == -1) {
@@ -88,7 +88,7 @@ static void write_wtmp(void)
88 utmp.ut_line[0] = '~'; utmp.ut_line[1] = '~'; /* = strcpy(utmp.ut_line, "~~"); */ 88 utmp.ut_line[0] = '~'; utmp.ut_line[1] = '~'; /* = strcpy(utmp.ut_line, "~~"); */
89 uname(&uts); 89 uname(&uts);
90 safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host)); 90 safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host));
91 updwtmp(bb_path_wtmp_file, &utmp); 91 updwtmpx(bb_path_wtmp_file, &utmp);
92} 92}
93#else 93#else
94#define write_wtmp() ((void)0) 94#define write_wtmp() ((void)0)