aboutsummaryrefslogtreecommitdiff
path: root/miscutils/wall.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 /miscutils/wall.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 'miscutils/wall.c')
-rw-r--r--miscutils/wall.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/miscutils/wall.c b/miscutils/wall.c
index bb709ee39..50658f457 100644
--- a/miscutils/wall.c
+++ b/miscutils/wall.c
@@ -32,7 +32,7 @@
32int wall_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 32int wall_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
33int wall_main(int argc UNUSED_PARAM, char **argv) 33int wall_main(int argc UNUSED_PARAM, char **argv)
34{ 34{
35 struct utmp *ut; 35 struct utmpx *ut;
36 char *msg; 36 char *msg;
37 int fd; 37 int fd;
38 38
@@ -46,8 +46,8 @@ int wall_main(int argc UNUSED_PARAM, char **argv)
46 msg = xmalloc_read(fd, NULL); 46 msg = xmalloc_read(fd, NULL);
47 if (ENABLE_FEATURE_CLEAN_UP && argv[1]) 47 if (ENABLE_FEATURE_CLEAN_UP && argv[1])
48 close(fd); 48 close(fd);
49 setutent(); 49 setutxent();
50 while ((ut = getutent()) != NULL) { 50 while ((ut = getutxent()) != NULL) {
51 char *line; 51 char *line;
52 if (ut->ut_type != USER_PROCESS) 52 if (ut->ut_type != USER_PROCESS)
53 continue; 53 continue;
@@ -56,7 +56,7 @@ int wall_main(int argc UNUSED_PARAM, char **argv)
56 free(line); 56 free(line);
57 } 57 }
58 if (ENABLE_FEATURE_CLEAN_UP) { 58 if (ENABLE_FEATURE_CLEAN_UP) {
59 endutent(); 59 endutxent();
60 free(msg); 60 free(msg);
61 } 61 }
62 return EXIT_SUCCESS; 62 return EXIT_SUCCESS;