From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 15:46:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13D06FFF; Sat, 26 Jul 2014 15:46:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0114B2682; Sat, 26 Jul 2014 15:46:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QFkfl4083749; Sat, 26 Jul 2014 15:46:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QFkfaw083748; Sat, 26 Jul 2014 15:46:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261546.s6QFkfaw083748@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 15:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269126 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jul 2014 15:46:42 -0000 Author: marcel Date: Sat Jul 26 15:46:41 2014 New Revision: 269126 URL: http://svnweb.freebsd.org/changeset/base/269126 Log: Don't return ERESTART when the device is gone. In ttydev_leave() ERESTART is the indication that draining got interrupted due to a revoke(2) and that tty_drain() is to be called again for draining to complete. If the device is flagged as gone, then waiting/draining is not possible. Only return ERESTART when waiting is still possible. Obtained from: Juniper Networks, Inc. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Jul 26 15:33:20 2014 (r269125) +++ head/sys/kern/tty.c Sat Jul 26 15:46:41 2014 (r269126) @@ -1370,14 +1370,14 @@ tty_wait(struct tty *tp, struct cv *cv) error = cv_wait_sig(cv, tp->t_mtx); - /* Restart the system call when we may have been revoked. */ - if (tp->t_revokecnt != revokecnt) - return (ERESTART); - /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); + /* Restart the system call when we may have been revoked. */ + if (tp->t_revokecnt != revokecnt) + return (ERESTART); + return (error); }