From 8af6a397e46865f65da4f71a47aff35b06bc0e92 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 1 Dec 2003 15:18:27 +0000 Subject: On sparc64 when I used the "w" command, the screen logins had absurdly large login and idle times. This was due to a bug in utmp.c: in os.h ------- # define utmp utmpx # define ut_time ut_xtime in utmp.c::makeuser() --------------------- struct utmp *u; (void)time((time_t *)&u->ut_time); The above works fine on i386 where ut_xtime and time_t are the same size, but on sparc64 ut_xtime is 8 bytes rather than 4. This fix was tested on i386 and sparc64. --- misc/screen/Makefile | 4 ++-- misc/screen/distinfo | 4 ++-- misc/screen/patches/patch-al | 20 +++++++++++++++++++- 3 files changed, 23 insertions(+), 5 deletions(-) (limited to 'misc/screen') diff --git a/misc/screen/Makefile b/misc/screen/Makefile index e8b0980b934..5144294c280 100644 --- a/misc/screen/Makefile +++ b/misc/screen/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.49 2003/11/27 20:29:48 wiz Exp $ +# $NetBSD: Makefile,v 1.50 2003/12/01 15:18:27 ben Exp $ DISTNAME= screen-4.0.1 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= misc MASTER_SITES= ftp://ftp.uni-erlangen.de/pub/utilities/screen/ \ ${MASTER_SITE_GNU:=screen/} diff --git a/misc/screen/distinfo b/misc/screen/distinfo index 2948069c7e1..e2d7b288b8c 100644 --- a/misc/screen/distinfo +++ b/misc/screen/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.15 2003/11/27 20:29:48 wiz Exp $ +$NetBSD: distinfo,v 1.16 2003/12/01 15:18:27 ben Exp $ SHA1 (screen-4.0.1.tar.gz) = 61f24b18c56b5862c769345d204f57b1e7f222ab Size (screen-4.0.1.tar.gz) = 837445 bytes @@ -9,7 +9,7 @@ SHA1 (patch-ae) = dcdbb1ca08e36308f5659a90a5b6f31fb3a45691 SHA1 (patch-ai) = a3d2c7d2ef3db9deb7a5e70ed7f906efd3196af6 SHA1 (patch-aj) = 8aa5c79e483e500ca9b3ed978835bbf1a866a5dc SHA1 (patch-ak) = 1e83c3406fb862e15f0fd5b90da8cf5310fbb68b -SHA1 (patch-al) = 2f042d43030a9166f4c1bf19e4d473d1031aba4e +SHA1 (patch-al) = 6ee93058847f3894a886346676e4a613c0bd134e SHA1 (patch-am) = 5fdc32f33ebbb5385292919f6cd01bedc30491d9 SHA1 (patch-an) = 9c5f451edb228f10daf593eba79f1fb11b4ffb24 SHA1 (patch-ao) = 81b0d64dd5918cd4d6fbc02dff0470a441a200d4 diff --git a/misc/screen/patches/patch-al b/misc/screen/patches/patch-al index 8d0504ca449..4b4e0cc736c 100644 --- a/misc/screen/patches/patch-al +++ b/misc/screen/patches/patch-al @@ -1,4 +1,4 @@ -$NetBSD: patch-al,v 1.1 2002/09/15 06:51:39 kim Exp $ +$NetBSD: patch-al,v 1.2 2003/12/01 15:18:27 ben Exp $ Make extra calls to remove utmp entries when utmpx is used. For non-login entries we only update utmpx, as it stores @@ -39,3 +39,21 @@ more information, and utilities are reading both. if (utmpok && D_loginslot != (slot_t)0 && D_loginslot != (slot_t)-1) { debug1(" logging you in again (slot %#x)\n", (int)D_loginslot); +@@ -604,6 +616,7 @@ + char *line, *user; + int pid; + { ++ time_t temp; + u->ut_type = USER_PROCESS; + strncpy(u->ut_user, user, sizeof(u->ut_user)); + /* Now the tricky part... guess ut_id */ +@@ -618,7 +631,8 @@ + #endif /* sgi */ + strncpy(u->ut_line, line, sizeof(u->ut_line)); + u->ut_pid = pid; +- (void)time((time_t *)&u->ut_time); ++ (void)time(&temp); ++ u->ut_time = temp; + } + + static slot_t -- cgit v1.2.3