Date: Sat, 11 Mar 2006 21:42:43 +0300 (MSK) From: Dmitry Marakasov <amdmi3@mail.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/94367: [patch] fix `wall: /dev/:0: No such file or directory' message on shutdown Message-ID: <20060311184243.D0C3F595@hades.panopticon> Resent-Message-ID: <200603111850.k2BIoaJW023806@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 94367 >Category: bin >Synopsis: [patch] fix `wall: /dev/:0: No such file or directory' message on shutdown >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Mar 11 18:50:35 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Dmitry Marakasov >Release: FreeBSD 6.0-RELEASE-p4 i386 >Organization: >Environment: System: FreeBSD hades.panopticon 6.0-RELEASE-p4 FreeBSD 6.0-RELEASE-p4 #1: Fri Jan 27 12:07:19 MSK 2006 amdmi3@hades.panopticon:/usr/obj/usr/src/sys/HADES i386 >Description: Calling `shutdown -r now` when running X session leads to this strange message on the console: wall: /dev/:0: No such file or directory That happens because X.org adds utmp entry with display number (not tty) in ut_line field, so `who` shows this: amdmi3 ttyp0 Mar 11 17:33 (:0.0) amdmi3 ttyp1 Mar 11 17:33 (:0.0) amdmi3 ttyp2 Mar 11 17:33 (:0.0) amdmi3 :0 Mar 11 17:33 /bin/wall, which is called on shutdown, tries to open /dev/:0 (along with /dev/tty*), and fails. Attached patch silences the warning message produced in this case. >How-To-Repeat: having running X session, do `shutdown -r now' >Fix: --- wall.patch begins here --- --- /usr/src/usr.bin/wall/ttymsg.c.orig Fri Oct 11 18:58:34 2002 +++ /usr/src/usr.bin/wall/ttymsg.c Sat Mar 11 21:25:10 2006 @@ -87,7 +87,7 @@ * if not running as root; not an error. */ if ((fd = open(device, O_WRONLY|O_NONBLOCK, 0)) < 0) { - if (errno == EBUSY || errno == EACCES) + if (errno == EBUSY || errno == EACCES || errno == ENOENT) return (NULL); (void) snprintf(errbuf, sizeof(errbuf), "%s: %s", device, strerror(errno)); --- wall.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060311184243.D0C3F595>