From 9ed21393e04c3b6b1aa9244d599de0ca3d2310c7 Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 28 Dec 2014 18:53:16 +0000 Subject: [PATCH] MFC r269126 & 272786: Don't return ERESTART when the device is gone. git-svn-id: svn://svn.freebsd.org/base/stable/10@276338 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/kern/tty.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 333378c9d..c244ff60e 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); } -- 2.45.0