summaryrefslogtreecommitdiffstats
path: root/ax25ipd/io.c
diff options
context:
space:
mode:
authorThomas Osterried <thomas@osterried.de>2008-04-13 22:50:26 +0000
committerThomas Osterried <thomas@osterried.de>2008-04-13 22:50:26 +0000
commitbb18a39b4a7f79f7bfe4861fdb8860e3eef58246 (patch)
treeac603e5261037f87be2a1f2ea4a6b78fc0ed4d10 /ax25ipd/io.c
parent561fa5359c69c006cf09827d2eb97daa6527b95f (diff)
io.c: WRITE to TTY returns -1 EAGAIN
if ttyqueue is full. The behaviour to give up here was wrong.
Diffstat (limited to 'ax25ipd/io.c')
-rw-r--r--ax25ipd/io.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ax25ipd/io.c b/ax25ipd/io.c
index 2e3ec07..8bcb4a5 100644
--- a/ax25ipd/io.c
+++ b/ax25ipd/io.c
@@ -541,6 +541,7 @@ int where; /* line in the code where this function was called */
#ifdef EAGAIN
if (errno == EAGAIN) {
+#ifdef notdef
/* select() said that data is available, but recvfrom sais
* EAGAIN - i really do not know what's the sense in this.. */
if (dir == READ_MSG && oops != TTY_MODE /* && != TCP_MODE, if we'd implement this */ )
@@ -550,6 +551,18 @@ int where; /* line in the code where this function was called */
fprintf(stderr, "behaviour. This is probably a result of compile-time environment.\n");
fprintf(stderr, "Mode 0x%2.2x, LINE: %d. During %s\n", mode, where, (dir == READ_MSG ? "READ" : "WRITE"));
exit(3);
+#else
+ int ret = 0;
+ if (dir == READ_MSG) {
+ LOGL4("read / recv returned -1 EAGAIN\n");
+ ret = 0;
+ } else if (dir == SEND_MSG) {
+ LOGL4("write / send returned -1 EAGAIN, sleeping and retrying!\n");
+ usleep(100000);
+ ret = 1;
+ }
+ return ret;
+#endif
}
#endif