Browse Source

update version to 0.7

detect short write in write_strip()

fix compilation warnings with gcc-2.95.4
Michael Elkins 23 years ago
parent
commit
087fb470e7
4 changed files with 15 additions and 4 deletions
  1. 1 0
      config.c
  2. 1 1
      configure.in
  3. 12 3
      imap.c
  4. 1 0
      maildir.c

+ 1 - 0
config.c

@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include "isync.h"
 
 config_t *boxes = 0;

+ 1 - 1
configure.in

@@ -1,5 +1,5 @@
 AC_INIT(isync.h)
-AM_INIT_AUTOMAKE(isync,0.6)
+AM_INIT_AUTOMAKE(isync,0.7)
 AM_PROG_CC_STDC
 AC_ARG_WITH(ssl-dir, [  --with-ssl-dir=DIR	location where openssl is insalled],
 	[if test -d $withval/lib; then

+ 12 - 3
imap.c

@@ -820,7 +820,7 @@ write_strip (int fd, char *buf, size_t len)
 {
     size_t start = 0;
     size_t end = 0;
-    int n;
+    ssize_t n;
 
     while (start < len)
     {
@@ -832,8 +832,17 @@ write_strip (int fd, char *buf, size_t len)
 	    perror ("write");
 	    return -1;
 	}
-	end++;
-	start = end;
+	else if ((size_t) n != end - start)
+	{
+	    /* short write, try again */
+	    start += n;
+	}
+	else
+	{
+	    /* write complete */
+	    end++;
+	    start = end;
+	}
     }
     return 0;
 }

+ 1 - 0
maildir.c

@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include <time.h>
 #include "isync.h"
 
 static int