mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] make n_hdlc honor O_NONBLOCK on write
@ 2008-07-17 13:55 Paul Fulghum
  0 siblings, 0 replies; only message in thread
From: Paul Fulghum @ 2008-07-17 13:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-17 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-17 13:55 [PATCH] make n_hdlc honor O_NONBLOCK on write Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome