chiark
/
gitweb
/
~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(writechan): Pointless tweak: when the buffer is empty, reset the start
[fwd]
/
chan.c
diff --git
a/chan.c
b/chan.c
index ad44891deb6b9a86a955461318c8cf767f9da67a..ffec633e0d36de8d93e740672f767f99be023dca 100644
(file)
--- a/
chan.c
+++ b/
chan.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: chan.c,v 1.
4 1999/08/31 17:42:49
mdw Exp $
+ * $Id: chan.c,v 1.
5 2000/07/19 17:55:43
mdw Exp $
*
* Channel management
*
*
* Channel management
*
@@
-29,6
+29,11
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: chan.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: chan.c,v $
+ * Revision 1.5 2000/07/19 17:55:43 mdw
+ * (writechan): Pointless tweak: when the buffer is empty, reset the start
+ * pointer to the beginning. This saves doing slightly trickier
+ * @writev(2)@ calls when loading is light.
+ *
* Revision 1.4 1999/08/31 17:42:49 mdw
* Use `sel_force' to avoid a `select' call between reads and writes.
*
* Revision 1.4 1999/08/31 17:42:49 mdw
* Use `sel_force' to avoid a `select' call between reads and writes.
*
@@
-119,8
+124,11
@@
static void writechan(int fd, unsigned mode, void *vp)
/* --- Close the output end if necessary --- */
/* --- Close the output end if necessary --- */
- if (c->len == 0 && (c->f & CHANF_CLOSE))
- c->func(c->p);
+ if (c->len == 0) {
+ c->base = 0;
+ if (c->f & CHANF_CLOSE)
+ c->func(c->p);
+ }
return;
/* --- Force a close if an error occurred --- */
return;
/* --- Force a close if an error occurred --- */