tty: notify read in addition to write when the other tty is closed
Reading a tty that's closed by the other side will return an end of file error, but will not block. Fixes #18486. Change-Id: I8441becdcc8c83c08611684fa0a29216e9d04ec8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6665 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
037c2257f9
commit
311dc3ca7d
@@ -1524,9 +1524,11 @@ tty_close_cookie(tty_cookie* cookie)
|
|||||||
|
|
||||||
requestLocker.Unlock();
|
requestLocker.Unlock();
|
||||||
|
|
||||||
// notify a select write event on the other tty, if we've closed this tty
|
// notify a select read and write event on the other tty, if we've closed this tty
|
||||||
if (cookie->other_tty->open_count > 0)
|
if (cookie->other_tty->open_count > 0) {
|
||||||
tty_notify_select_event(cookie->other_tty, B_SELECT_WRITE);
|
tty_notify_select_event(cookie->other_tty, B_SELECT_WRITE);
|
||||||
|
tty_notify_select_event(cookie->other_tty, B_SELECT_READ);
|
||||||
|
}
|
||||||
|
|
||||||
cookie->tty->is_exclusive = false;
|
cookie->tty->is_exclusive = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user