From owner-cvs-all@FreeBSD.ORG Mon Nov 12 20:02:21 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9261616A417; Mon, 12 Nov 2007 20:02:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 834FA13C4C2; Mon, 12 Nov 2007 20:02:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lACK2LG9039341; Mon, 12 Nov 2007 20:02:21 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lACK2LPg039340; Mon, 12 Nov 2007 20:02:21 GMT (envelope-from jhb) Message-Id: <200711122002.lACK2LPg039340@repoman.freebsd.org> From: John Baldwin Date: Mon, 12 Nov 2007 20:02:21 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/usr.bin/write write.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2007 20:02:21 -0000 jhb 2007-11-12 20:02:21 UTC FreeBSD src repository Modified files: usr.bin/write write.c Log: write(1) needs to strip off the leading /dev/ from the tty name for the current tty as returned from ttyname(3) so it can try to avoid writing to the current tty if possible. Previously, it did this by trimming off any leading directory (effectively performing a basename(3) on the path returned from ttyname(3)). However, this chopped off too much of the path for ttys who have directories in their name such as pts(4). Instead, just strip off the leading /dev/ from the path returned by ttyname(3). This fixes write(1) when using pts(4). MFC after: 1 week Reported by: rwatson Revision Changes Path 1.19 +2 -3 src/usr.bin/write/write.c