bin/94367: [patch] fix `wall: /dev/:0: No such file or directory' message on shutdown

Dmitry Marakasov amdmi3 at mail.ru
Sat Mar 11 18:50:37 GMT 2006


>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 at 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:


More information about the freebsd-bugs mailing list