diff options
author | Amadeusz Sławiński <amade@asmblr.net> | 2015-06-13 17:52:46 +0200 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2015-06-13 18:00:58 +0200 |
commit | 74fdc8988b55633cd05f8625390cd3f6a8102003 (patch) | |
tree | 5b1c279f146cc752228700851de44f1f806b2e91 | |
parent | 95b05ac4e1845eedfdf375ddd4a8cf424f092246 (diff) | |
download | screen-74fdc8988b55633cd05f8625390cd3f6a8102003.tar.gz |
change checks for utmp/utmpx in header
linuxes should've working utmpx, so this check was bit weird
commit 2b1bdf96 mentions some "linux workaround", but nothing specific
fixes build with musl libc
-rw-r--r-- | src/os.h | 7 | ||||
-rw-r--r-- | src/utmp.c | 4 |
2 files changed, 6 insertions, 5 deletions
@@ -250,9 +250,11 @@ extern int errno; #endif #if defined(UTMPOK) || defined(BUGGYGETLOGIN) -# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) +# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) # include <utmpx.h> -# define UTMPFILE UTMPX_FILE +# ifdef UTMPX_FILE /* GNU extension */ +# define UTMPFILE UTMPX_FILE +# endif # define utmp utmpx # define getutent getutxent # define getutid getutxid @@ -260,7 +262,6 @@ extern int errno; # define pututline pututxline # define setutent setutxent # define endutent endutxent -# define ut_time ut_xtime # else /* SVR4 */ # include <utmp.h> # endif /* SVR4 */ @@ -631,7 +631,7 @@ int pid; /* must use temp variable because of NetBSD/sparc64, where * ut_xtime is long(64) but time_t is int(32) */ (void)time(&now); - u->ut_time = now; + u->ut_tv.tv_sec = now; } static slot_t @@ -743,7 +743,7 @@ int pid; strncpy(u->ut_line, line, sizeof(u->ut_line)); strncpy(u->ut_name, user, sizeof(u->ut_name)); (void)time(&now); - u->ut_time = now; + u->ut_tv.tv_sec = now; } static slot_t |