aboutsummaryrefslogtreecommitdiffstats
path: root/src/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/raw.c')
-rw-r--r--src/raw.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/raw.c b/src/raw.c
index bd48355..90960c6 100644
--- a/src/raw.c
+++ b/src/raw.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.10 2011/02/28 18:10:43 james
+ * *** empty log message ***
+ *
* Revision 1.9 2011/02/06 16:51:22 james
* *** empty log message ***
*
@@ -86,6 +89,23 @@ rx_new_raw (int rfd, int wfd)
return (RX *) ret;
}
+static int my_wrap_read (int fd, void *buf, int len)
+{
+ int red;
+
+ red = read (fd, buf, len);
+#if 1
+ if (!red)
+ return -1;
+#endif
+
+ if ((red < 0) && (errno == EAGAIN))
+ red = 0;
+
+ return red;
+}
+
+
static int
raw_terminal_read (TTY * _t, void *buf, int len)
@@ -97,7 +117,7 @@ raw_terminal_read (TTY * _t, void *buf, int len)
do {
- red = wrap_read (t->rfd, buf, len);
+ red = my_wrap_read (t->rfd, buf, len);
if (red < 0)
return done ? done:-1;
if (!red)