aboutsummaryrefslogtreecommitdiff
path: root/src/mbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbox.c')
-rw-r--r--src/mbox.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mbox.c b/src/mbox.c
index 635a4888..05efa69f 100644
--- a/src/mbox.c
+++ b/src/mbox.c
@@ -380,17 +380,23 @@ gint copy_mbox(const gchar *src, const gchar *dest)
void empty_mbox(const gchar *mbox)
{
+#if HAVE_TRUNCATE
if (truncate(mbox, 0) < 0) {
+#endif
FILE *fp;
+#if HAVE_TRUNCATE
FILE_OP_ERROR(mbox, "truncate");
+#endif
if ((fp = fopen(mbox, "wb")) == NULL) {
FILE_OP_ERROR(mbox, "fopen");
g_warning(_("can't truncate mailbox to zero.\n"));
return;
}
fclose(fp);
+#if HAVE_TRUNCATE
}
+#endif
}
/* read all messages in SRC, and store them into one MBOX file. */