Commit c72f527c authored by Paul Fulghum's avatar Paul Fulghum Committed by Linus Torvalds

n_hdlc: honor O_NONBLOCK on write

Make n_hdlc line discipline honor the O_NONBLOCK file flag on write.
Signed-off-by: default avatarPaul Fulghum <paulkf@microgate.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 768aec0b
...@@ -677,6 +677,10 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, ...@@ -677,6 +677,10 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
/* Allocate transmit buffer */ /* Allocate transmit buffer */
/* sleep until transmit buffer available */ /* sleep until transmit buffer available */
while (!(tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list))) { while (!(tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list))) {
if (file->f_flags & O_NONBLOCK) {
error = -EAGAIN;
break;
}
schedule(); schedule();
n_hdlc = tty2n_hdlc (tty); n_hdlc = tty2n_hdlc (tty);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment