Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/tty.c
Show First 20 Lines • Show All 1,536 Lines • ▼ Show 20 Lines | |||||
tty_wait(struct tty *tp, struct cv *cv) | tty_wait(struct tty *tp, struct cv *cv) | ||||
{ | { | ||||
int error; | int error; | ||||
int revokecnt = tp->t_revokecnt; | int revokecnt = tp->t_revokecnt; | ||||
tty_lock_assert(tp, MA_OWNED|MA_NOTRECURSED); | tty_lock_assert(tp, MA_OWNED|MA_NOTRECURSED); | ||||
MPASS(!tty_gone(tp)); | MPASS(!tty_gone(tp)); | ||||
error = cv_wait_sig(cv, tp->t_mtx); | error = cv_wait_sig_flags(cv, tp->t_mtx, C_USERWAIT); | ||||
/* Bail out when the device slipped away. */ | /* Bail out when the device slipped away. */ | ||||
if (tty_gone(tp)) | if (tty_gone(tp)) | ||||
return (ENXIO); | return (ENXIO); | ||||
/* Restart the system call when we may have been revoked. */ | /* Restart the system call when we may have been revoked. */ | ||||
if (tp->t_revokecnt != revokecnt) | if (tp->t_revokecnt != revokecnt) | ||||
return (ERESTART); | return (ERESTART); | ||||
▲ Show 20 Lines • Show All 891 Lines • Show Last 20 Lines |