Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jul 2014 15:46:41 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269126 - head/sys/kern
Message-ID:  <201407261546.s6QFkfaw083748@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407261546.s6QFkfaw083748>