MFC r269126 & 272786:

Don't return ERESTART when the device is gone.
This commit is contained in:
marcel 2014-12-28 18:53:16 +00:00
parent 3ba73f92a6
commit 5fceeec31e

View File

@ -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);
}