From owner-freebsd-stable Mon Sep 23 21:42:20 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C2ED337B404 for ; Mon, 23 Sep 2002 21:42:18 -0700 (PDT) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05AA943E7B for ; Mon, 23 Sep 2002 21:42:17 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id g8O4edGG024104; Mon, 23 Sep 2002 21:40:39 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id g8O4ecE2024103; Mon, 23 Sep 2002 21:40:38 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Mon, 23 Sep 2002 21:40:38 -0700 From: David Schultz To: Jonathan Chen Cc: Andrew Gordon , AlanE , FreeBSD Stable List Subject: Re: Weird uptime(1) output Message-ID: <20020924044038.GA24016@HAL9000.homeunix.com> Mail-Followup-To: Jonathan Chen , Andrew Gordon , AlanE , FreeBSD Stable List References: <20020923033214.GB48084@wwweasel.geeksrus.net> <20020923110213.L2298-100000@server.arg.sj.co.uk> <20020923200612.GC2872@grimoire.chen.org.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020923200612.GC2872@grimoire.chen.org.nz> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Jonathan Chen : > > --- usr.bin/w/w.c 12 Mar 2002 19:51:51 -0000 1.38.2.6 > > +++ usr.bin/w/w.c 23 Sep 2002 15:00:45 -0000 > > @@ -504,6 +504,12 @@ > > static struct stat sb; > > char ttybuf[MAXPATHLEN]; > > > > + if (line[0] == ':') { > > + /* Assume an X login via sessreg */ > > + time(&sb.st_atime); > > + sb.st_rdev = -1; > > + return (&sb); > > + } > > (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, > > line); > > if (stat(ttybuf, &sb)) { > > warn("%s", ttybuf); > > > > The patch doesn't work if you have a remote X-server logging onto the > system, as $DISPLAY will be "host:0.0" in most cases. Perhaps an > index(3) on line? If you want it to work that way, all the patch needs to do is disable the warning when it can't find the terminal. Note that you'll also have to patch wall(1). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message