Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Dec 2014 18:53:17 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r276338 - stable/10/sys/kern
Message-ID:  <201412281853.sBSIrH9U013677@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Dec 28 18:53:16 2014
New Revision: 276338
URL: https://svnweb.freebsd.org/changeset/base/276338

Log:
  MFC r269126 & 272786:
  Don't return ERESTART when the device is gone.

Modified:
  stable/10/sys/kern/tty.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/tty.c
==============================================================================
--- stable/10/sys/kern/tty.c	Sun Dec 28 18:43:39 2014	(r276337)
+++ stable/10/sys/kern/tty.c	Sun Dec 28 18:53:16 2014	(r276338)
@@ -1391,14 +1391,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);
 }
 
@@ -1413,14 +1413,14 @@ tty_timedwait(struct tty *tp, struct cv 
 
 	error = cv_timedwait_sig(cv, tp->t_mtx, hz);
 
-	/* 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?201412281853.sBSIrH9U013677>