summaryrefslogtreecommitdiffstats
path: root/sysdep/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/io.c2
-rw-r--r--sysdep/unix/main.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 35af2df..895f537 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -870,7 +870,7 @@ sk_write(sock *s)
case SK_DELETED:
return;
default:
- while (s->ttx != s->tbuf && sk_maybe_write(s) > 0)
+ while (s->ttx != s->tpos && sk_maybe_write(s) > 0)
s->tx_hook(s);
}
}
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 621d85c..06d1d1d 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -179,9 +179,10 @@ cli_write(cli *c)
struct cli_out *o = c->tx_pos;
c->tx_pos = o->next;
s->tbuf = o->outpos;
- return sk_send(s, o->wpos - o->outpos);
+ if (sk_send(s, o->wpos - o->outpos) > 0)
+ ev_schedule(c->event);
}
- return 1;
+ return !c->tx_pos;
}
int