summaryrefslogtreecommitdiffstats
path: root/drivers/char/n_hdlc.c
diff options
context:
space:
mode:
authorPaul Fulghum <paulkf@microgate.com>2008-07-22 11:21:19 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-22 13:03:28 -0700
commitc72f527c104cae8e767e714574238b5550879e0c (patch)
treef89edb1543e72d73ebeccf9bbb9aec0592d52ec9 /drivers/char/n_hdlc.c
parent768aec0b5bccbd460bcf6e9131f19b5a26f3862d (diff)
downloadlinux-c72f527c104cae8e767e714574238b5550879e0c.tar.gz
linux-c72f527c104cae8e767e714574238b5550879e0c.tar.bz2
linux-c72f527c104cae8e767e714574238b5550879e0c.zip
n_hdlc: honor O_NONBLOCK on write
Make n_hdlc line discipline honor the O_NONBLOCK file flag on write. Signed-off-by: Paul Fulghum <paulkf@microgate.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/n_hdlc.c')
-rw-r--r--drivers/char/n_hdlc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index ed4e03333ab4..69ec6399c714 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -677,6 +677,10 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
/* Allocate transmit buffer */
/* sleep until transmit buffer available */
while (!(tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list))) {
+ if (file->f_flags & O_NONBLOCK) {
+ error = -EAGAIN;
+ break;
+ }
schedule();
n_hdlc = tty2n_hdlc (tty);