diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-12-30 22:30:58 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-12-30 22:30:58 +0000 |
commit | 1244e654b243695367e70e847b74dac09f6fcee6 (patch) | |
tree | d96c4f7b973461da2c26370693f83e97ab01be5a | |
parent | 713fbf44b139d72191692be6c01ccdb95451870c (diff) | |
download | fetchmail-1244e654b243695367e70e847b74dac09f6fcee6.tar.gz fetchmail-1244e654b243695367e70e847b74dac09f6fcee6.tar.bz2 fetchmail-1244e654b243695367e70e847b74dac09f6fcee6.zip |
This version seems to work.
svn path=/trunk/; revision=711
-rw-r--r-- | socket.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 |