summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2014-12-28 18:53:16 +0000
committermarcel <marcel@FreeBSD.org>2014-12-28 18:53:16 +0000
commit5fceeec31e9289a8ab54c552977aef692689a17c (patch)
tree0627fbafef2ed84279364243a4861e60ab93409a /sys/kern
parent3ba73f92a6d8908b915f88ed7e59f2626bb5c0c3 (diff)
downloadFreeBSD-src-5fceeec31e9289a8ab54c552977aef692689a17c.zip
FreeBSD-src-5fceeec31e9289a8ab54c552977aef692689a17c.tar.gz
MFC r269126 & 272786:
Don't return ERESTART when the device is gone.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/tty.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 333378c..c244ff6 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -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 *cv, int hz)
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);
}
OpenPOWER on IntegriCloud