summaryrefslogtreecommitdiff
path: root/libutil/login.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-03-25 23:59:45 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-03-25 23:59:45 +0100
commit6ff9c31abc14f207265ab214370982ecb3bfe428 (patch)
treeafdaf5624e71c939c39abe8ef3aba5980aa4d911 /libutil/login.c
parent2b33716c08cc506e57115e34b5fe11d8d5477398 (diff)
utmp: favour POSIX utmpx over SVID utmp
Note: _PATH_UTMPX == _PATH_UTMP and the utmp struct is identical to the utmpx struct so this only changes the external API entrypoints and NOT the underlying data source. This saves about 500b (~1300b from previously ~1950) while at it. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libutil/login.c')
-rw-r--r--libutil/login.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libutil/login.c b/libutil/login.c
index 4007e4c7e..971997d4a 100644
--- a/libutil/login.c
+++ b/libutil/login.c
@@ -3,7 +3,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <utmp.h>
+#include "internal/utmp.h"
/* Write the given entry into utmp and wtmp.
* Note: the match in utmp is done against ut_id field,
@@ -11,7 +11,7 @@
*/
void login(const struct utmp *entry)
{
- struct utmp copy;
+ struct UT copy;
char tty_name[sizeof(copy.ut_line) + 6];
int fd;
@@ -20,7 +20,7 @@ void login(const struct utmp *entry)
// (if there is such a field) with the value USER_PROCESS,
// and fills the field ut->ut_pid (if there is such a field)
// with the process ID of the calling process.
- copy = *entry;
+ copy = *((const struct UT *)(entry));
#if _HAVE_UT_TYPE - 0
copy.ut_type = USER_PROCESS;
#endif