From amdmi3@mail.ru  Sat Mar 11 18:42:15 2006
Return-Path: <amdmi3@mail.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5890116A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Mar 2006 18:42:15 +0000 (GMT)
	(envelope-from amdmi3@mail.ru)
Received: from mx7.mail.ru (mx7.mail.ru [194.67.23.27])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CA5D643D49
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Mar 2006 18:42:14 +0000 (GMT)
	(envelope-from amdmi3@mail.ru)
Received: from [213.148.29.33] (port=50232 helo=nexii.panopticon)
	by mx7.mail.ru with esmtp 
	id 1FI92a-000OMl-00
	for FreeBSD-gnats-submit@freebsd.org; Sat, 11 Mar 2006 21:42:13 +0300
Received: from hades.panopticon (hades.panopticon [192.168.0.2])
	by nexii.panopticon (Postfix) with ESMTP id CBF4E1140F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Mar 2006 21:45:52 +0300 (MSK)
Received: by hades.panopticon (Postfix, from userid 1000)
	id D0C3F595; Sat, 11 Mar 2006 21:42:43 +0300 (MSK)
Message-Id: <20060311184243.D0C3F595@hades.panopticon>
Date: Sat, 11 Mar 2006 21:42:43 +0300 (MSK)
From: Dmitry Marakasov <amdmi3@mail.ru>
Reply-To: Dmitry Marakasov <amdmi3@mail.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] fix `wall: /dev/:0: No such file or directory' message on shutdown
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         94367
>Category:       bin
>Synopsis:       [patch] wall(1): fix `wall: /dev/:0: No such file or directory' message on shutdown
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 11 18:50:35 GMT 2006
>Closed-Date:    Mon Jan 07 17:24:01 UTC 2008
>Last-Modified:  Mon Jan 07 17:24:01 UTC 2008
>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:

From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/94367: [patch] wall(1): fix `wall: /dev/:0: No such file
	or directory' message on shutdown
Date: Mon, 7 Jan 2008 20:15:47 +0300

 The issue was fixed in rev. 1.24 of src/usr.bin/wall/wall.c.
 Please close this PR.
 
 -- 
 Dmitry A. Marakasov    | jabber: amdmi3@jabber.ru
 amdmi3@amdmi3.ru       | http://www.amdmi3.ru
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Mon Jan 7 17:24:00 UTC 2008 
State-Changed-Why:  
The submitter reports that this had been fixed, close ticket. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94367 
>Unformatted:
