From 087fb470e7b1b31834f45e7c7728d3ca857247ae Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Fri, 9 Nov 2001 00:23:50 +0000 Subject: [PATCH] update version to 0.7 detect short write in write_strip() fix compilation warnings with gcc-2.95.4 --- config.c | 1 + configure.in | 2 +- imap.c | 15 ++++++++++++--- maildir.c | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/config.c b/config.c index 5fe06dd..b5687fc 100644 --- a/config.c +++ b/config.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "isync.h" config_t *boxes = 0; diff --git a/configure.in b/configure.in index 4e69771..d07b136 100644 --- a/configure.in +++ b/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 diff --git a/imap.c b/imap.c index 706eaa8..fc81c4e 100644 --- a/imap.c +++ b/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; } diff --git a/maildir.c b/maildir.c index 624e264..5c59fcc 100644 --- a/maildir.c +++ b/maildir.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "isync.h" static int