lkml.org 
[lkml]   [2008]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] make n_hdlc honor O_NONBLOCK on write
From
Date
Make n_hdlc line discipline honor the O_NONBLOCK
file flag on write.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>

--- a/drivers/char/n_hdlc.c 2008-07-17 08:39:15.000000000 -0500
+++ b/drivers/char/n_hdlc.c 2008-07-17 08:43:58.000000000 -0500
@@ -677,6 +677,10 @@ static ssize_t n_hdlc_tty_write(struct t
/* 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);



\
 
 \ /
  Last update: 2008-07-17 17:11    [W:0.029 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site