Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5c66303
)
make sure we don't chew too much CPU when the outgoing fd is full
author
Andrew Tridgell
<tridge@samba.org>
Tue, 29 Aug 2000 05:07:08 +0000
(
05:07
+0000)
committer
Andrew Tridgell
<tridge@samba.org>
Tue, 29 Aug 2000 05:07:08 +0000
(
05:07
+0000)
io.c
patch
|
blob
|
blame
|
history
diff --git
a/io.c
b/io.c
index
b469d8b
..
2f4162c
100644
(file)
--- a/
io.c
+++ b/
io.c
@@
-372,6
+372,7
@@
static void writefd_unbuffered(int fd,char *buf,int len)
if (ret == -1 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
if (ret == -1 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
+ msleep(1);
continue;
}
continue;
}
@@
-463,6
+464,17
@@
void io_end_buffering(int fd)
}
}
}
}
+/* some OSes have a bug where an exit causes the pending writes on
+ a socket to be flushed. Do an explicit shutdown to try to prevent this */
+void io_shutdown(void)
+{
+ if (multiplex_out_fd != -1) close(multiplex_out_fd);
+ if (io_error_fd != -1) close(io_error_fd);
+ multiplex_out_fd = -1;
+ io_error_fd = -1;
+}
+
+
static void writefd(int fd,char *buf,int len)
{
stats.total_written += len;
static void writefd(int fd,char *buf,int len)
{
stats.total_written += len;