]> granicus.if.org Git - mutt/commitdiff
Fix incompatible return value checking. This should fix #29.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 2 Mar 2000 09:53:42 +0000 (09:53 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 2 Mar 2000 09:53:42 +0000 (09:53 +0000)
mh.c
mx.c

diff --git a/mh.c b/mh.c
index 32ebf56f5d10895029c40efaa9a3b78c4bc0b282..0c8ddf6555dc713e33eb648e94ecc252bd54b4ce 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -718,12 +718,10 @@ static int maildir_sync_message (CONTEXT *ctx, int msgno)
 int mh_sync_mailbox (CONTEXT * ctx)
 {
   char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX];
-  int i, j, rc = 0;
+  int i, j;
 
-  i = mh_check_mailbox(ctx, NULL);
-
-  if(i == M_REOPENED || i == M_NEW_MAIL || i < 0)
-    return i;
+  if (mh_check_mailbox(ctx, NULL) != 0)
+    return -1;
 
   for (i = 0; i < ctx->msgcount; i++)
   {
@@ -774,7 +772,7 @@ int mh_sync_mailbox (CONTEXT * ctx)
     }
   }
 
-  return (rc);
+  return 0;
 }
 
 static char *maildir_canon_filename(char *dest, char *src, size_t l)
diff --git a/mx.c b/mx.c
index e6375e07c47a2fa2cf5aa245d3d94adac6017961..4bb116e32743758f590e85888cb27736c680c626 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -907,7 +907,7 @@ int mx_close_mailbox (CONTEXT *ctx)
 
     if (ctx->changed || ctx->deleted)
     {
-      if (sync_mailbox (ctx) == -1)
+      if (sync_mailbox (ctx) != 0)
         return -1;
     }
   }