Date: Fri, 15 Aug 2003 17:08:08 -0400 (EDT) From: Robert Watson <rwatson@freebsd.org> To: Jonathan Chen <jonc@chen.org.nz> Cc: freebsd-stable@freebsd.org Subject: Re: odd uptime error message Message-ID: <Pine.NEB.3.96L.1030815170156.11577B-200000@fledge.watson.org> In-Reply-To: <20030814222123.GB65897@grimoire.chen.org.nz>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Fri, 15 Aug 2003, Jonathan Chen wrote: > On Thu, Aug 14, 2003 at 02:14:07PM -0700, Eric S wrote: > > > > I checked the archives and /usr/src/UPDATING and didn't see anything > > relating to this, and I might have easily missed it in the digest. I've > > got two different boxes that are running a recent -stable, and recently > > they both started spitting out the error message > > > > uptime: /dev/:0: No such file or directory > > It's in the archives: > > http://lists.freebsd.org/pipermail/freebsd-questions/2003-April/004276.html > > You can fiddle with /usr/local/share/config/kdm/Xreset and Xstartup to > get rid of this message. I personally use "-l console" I fixed an almost identical bug (feature) in finger in -CURRENT a couple of months ago. As with w, et a., finger attempts to stat each of the terminals listed in utmp. The fix is to ignore ENOENT in whatever code it is that's attempting to stat the terminals and skip the terminal in question. In fact, it looks like this has even been fixed in -CURRENT already: revision 1.55 date: 2002/08/23 04:31:58; author: seanc; state: Exp; lines: +3 -4 Fix warning when calling w(1) when logged in via xdm/kdm. This is really a problem with utmp/wtmp, but takes the same approach as who(1). Reviewed by: knu (mentor), mini, silence on -audit Approved by: knu (mentor), mini The attached patch probably does what you want -- if so, let me know, and I'll commit it. Apply the patch in src/usr.bin/w; then make, make install. If the finger patch hasn't been merged, it probably should be also. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories [-- Attachment #2 --] Index: w.c =================================================================== RCS file: /data/ncvs/src/usr.bin/w/w.c,v retrieving revision 1.38.2.6 diff -u -r1.38.2.6 w.c --- w.c 12 Mar 2002 19:51:51 -0000 1.38.2.6 +++ w.c 15 Aug 2003 21:06:40 -0000 @@ -505,11 +505,10 @@ char ttybuf[MAXPATHLEN]; (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line); - if (stat(ttybuf, &sb)) { - warn("%s", ttybuf); + if (stat(ttybuf, &sb) == 0) { + return (&sb); + } else return (NULL); - } - return (&sb); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1030815170156.11577B-200000>
