~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 1.3.9.
[fwd]
/
chan.c
diff --git
a/chan.c
b/chan.c
index
e5b6d06
..
9aa42a5
100644
(file)
--- a/
chan.c
+++ b/
chan.c
@@
-80,9
+80,9
@@
static void writechan(int fd, unsigned mode, void *vp)
if (w < 0) {
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
return;
if (w < 0) {
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
return;
+ c->err = errno;
goto close;
goto close;
- }
- else if (w == 0)
+ } else if (w == 0)
goto close;
else if (c->len == CHAN_BUFSZ && !(c->f & CHANF_CLOSE))
sel_addfile(&c->r);
goto close;
else if (c->len == CHAN_BUFSZ && !(c->f & CHANF_CLOSE))
sel_addfile(&c->r);
@@
-153,9
+153,9
@@
static void readchan(int fd, unsigned mode, void *vp)
if (r < 0) {
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
return;
if (r < 0) {
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
return;
+ c->err = errno;
goto close;
goto close;
- }
- else if (r == 0)
+ } else if (r == 0)
goto close;
else if (c->len == 0 && (c->f & CHANF_READY)) {
sel_addfile(&c->w);
goto close;
else if (c->len == 0 && (c->f & CHANF_READY)) {
sel_addfile(&c->w);
@@
-240,6
+240,7
@@
void chan_open(chan *c, int from, int to,
c->base = 0;
c->len = 0;
c->f = 0;
c->base = 0;
c->len = 0;
c->f = 0;
+ c->err = 0;
sel_initfile(sel, &c->r, from, SEL_READ, readchan, c);
sel_addfile(&c->r);
sel_initfile(sel, &c->r, from, SEL_READ, readchan, c);
sel_addfile(&c->r);