aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-12-30 22:30:58 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-12-30 22:30:58 +0000
commit1244e654b243695367e70e847b74dac09f6fcee6 (patch)
treed96c4f7b973461da2c26370693f83e97ab01be5a /socket.c
parent713fbf44b139d72191692be6c01ccdb95451870c (diff)
downloadfetchmail-1244e654b243695367e70e847b74dac09f6fcee6.tar.gz
fetchmail-1244e654b243695367e70e847b74dac09f6fcee6.tar.bz2
fetchmail-1244e654b243695367e70e847b74dac09f6fcee6.zip
This version seems to work.
svn path=/trunk/; revision=711
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/socket.c b/socket.c
index 385b458e..4b4f5279 100644
--- a/socket.c
+++ b/socket.c
@@ -38,9 +38,10 @@
* There are, in effect, two different implementations here. One
* uses read(2) and write(2) directly with no buffering, the other
* uses stdio with line buffering (for better throughput). Both
- * are known to work under Linux.
+ * are known to work under Linux. You get the former by configuring
+ * with --disable-stdio, the latter by configuring with --enable-stdio
+ * or by default.
*/
-/* #define USE_STDIO */
#ifdef USE_STDIO
/*
@@ -162,12 +163,17 @@ char *SockGets(char *buf, int len, FILE *sockfp)
int SockWrite(char *buf, int size, int len, FILE *sockfp)
{
- return(fwrite(buf, size, len, sockfp));
+ int n = fwrite(buf, size, len, sockfp);
+
+ fseek(sockfp, 0L, SEEK_CUR); /* required by POSIX */
+
+ return(n);
}
char *SockGets(char *buf, int len, FILE *sockfp)
{
return(fgets(buf, len, sockfp));
+
}
#endif