aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-12-23 23:14:17 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-12-23 23:14:17 +0000
commitd2ee52d171596bb3d6771d940c3a007545a133b1 (patch)
treedc7bfcf7907543922580f34ddf41458c793f3d94 /socket.c
parentcd098d6a1b13a2fc72310204dd51573c71129ada (diff)
downloadfetchmail-d2ee52d171596bb3d6771d940c3a007545a133b1.tar.gz
fetchmail-d2ee52d171596bb3d6771d940c3a007545a133b1.tar.bz2
fetchmail-d2ee52d171596bb3d6771d940c3a007545a133b1.zip
A version of setvbuf that works.
svn path=/trunk/; revision=679
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/socket.c b/socket.c
index fbe26ef7..39b9f846 100644
--- a/socket.c
+++ b/socket.c
@@ -74,23 +74,8 @@ FILE *sockopen(char *host, int clientPort)
}
fp = fdopen(sock, "r+");
-#ifdef __SETVBUF_WORKS_OK__
- /*
- * For unknown reasons, this results in horrible lossage under Linux.
- * To see this, condition in this line, generate a test pattern
- * of 8K, fetch it, and watch it garble the test pattern.
- * I think there's a bug in Linux stdio lurking here.
- */
- {
- static char sbuf[INTERNAL_BUFSIZE];
- setvbuf(fp, sbuf, _IOLBF, INTERNAL_BUFSIZE);
- }
-#endif /* __SETVBUF_WORKS_OK__ */
-
-#if !defined(__SETVBUF_WORKS_OK__) && defined(HAVE_SETLINEBUF)
- /* this on the other hand works OK under Linux */
- setlinebuf(fp);
-#endif
+ /* the point of all this mishigoss ... dynamic per-stream buffering */
+ setvbuf(fp, NULL, _IOLBF, INTERNAL_BUFSIZE);
return(fp);
}