summaryrefslogtreecommitdiffstats
path: root/mbox.c
diff options
context:
space:
mode:
authorMichael Elkins <me@sigpipe.org>2013-04-10 22:38:47 +0000
committerMichael Elkins <me@sigpipe.org>2013-04-10 22:38:47 +0000
commit564787560c432d02dfc311ec3489f227d2a56abb (patch)
tree0cba759d6b7b1fd0a44d02ed8e68cb7b3bd00267 /mbox.c
parent72e8127293f8fee15e9f68efaaf85bfc10310463 (diff)
fix various compiler warnings; most were due to unchecked return values from system calls.
Diffstat (limited to 'mbox.c')
-rw-r--r--mbox.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mbox.c b/mbox.c
index 2af4dd22..e69870d4 100644
--- a/mbox.c
+++ b/mbox.c
@@ -968,7 +968,11 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
if (i == 0)
{
ctx->size = ftello (ctx->fp); /* update the size of the mailbox */
- ftruncate (fileno (ctx->fp), ctx->size);
+ if (ftruncate (fileno (ctx->fp), ctx->size) == -1)
+ {
+ dprint(1, (debugfile, "%s:%d ftrunctate() returned -1, errno=%d\n", __FILE__, __LINE__, errno));
+ i = -1;
+ }
}
}