]> Pileus Git - ~andy/fetchmail/commitdiff
This version seems to work.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 30 Dec 1996 22:30:58 +0000 (22:30 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 30 Dec 1996 22:30:58 +0000 (22:30 -0000)
svn path=/trunk/; revision=711

socket.c

index 385b458e103849e3d34868d7486a77801cb366d8..4b4f5279c99dd4c9d38beebed629824eda704472 100644 (file)
--- a/socket.c
+++ b/socket.c
  * 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