From: Damien Riegel Date: Thu, 12 May 2016 19:41:01 +0000 (-0700) Subject: rename mbox_close_mailbox to mx_close_mailbox_append and move it X-Git-Tag: mutt-1-7-rel~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=740c8600dbb82a03f99370dd293a026ec5d56492;p=mutt rename mbox_close_mailbox to mx_close_mailbox_append and move it mbox_close_mailbox was used as the counterpart of mx_open_mailbox_append. To make things clearer, rename it mx_close_mailbox_append. As it is only used in mx.c, move it there and make it static. --- diff --git a/mbox.c b/mbox.c index 74f45d53..83c9cd87 100644 --- a/mbox.c +++ b/mbox.c @@ -1069,15 +1069,6 @@ bail: /* Come here in case of disaster */ return rc; } -/* close a mailbox opened in write-mode */ -int mbox_close_mailbox (CONTEXT *ctx) -{ - mx_unlock_file (ctx->path, fileno (ctx->fp), 1); - mutt_unblock_signals (); - mx_fastclose_mailbox (ctx); - return 0; -} - int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint) { int (*cmp_headers) (const HEADER *, const HEADER *) = NULL; diff --git a/mx.c b/mx.c index 086660ab..3f47932d 100644 --- a/mx.c +++ b/mx.c @@ -572,6 +572,15 @@ static int mx_open_mailbox_append (CONTEXT *ctx, int flags) return 0; } +/* close a mailbox opened in write-mode */ +static int mx_close_mailbox_append (CONTEXT *ctx) +{ + mx_unlock_file (ctx->path, fileno (ctx->fp), 1); + mutt_unblock_signals (); + mx_fastclose_mailbox (ctx); + return 0; +} + /* * open a mailbox and parse it * @@ -801,7 +810,7 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) { /* mailbox was opened in write-mode */ if (ctx->magic == MUTT_MBOX || ctx->magic == MUTT_MMDF) - mbox_close_mailbox (ctx); + mx_close_mailbox_append (ctx); else mx_fastclose_mailbox (ctx); return 0; diff --git a/mx.h b/mx.h index a4ac2b22..18562df4 100644 --- a/mx.h +++ b/mx.h @@ -46,7 +46,6 @@ WHERE short DefaultMagic INITVAL (MUTT_MBOX); int mbox_sync_mailbox (CONTEXT *, int *); int mbox_open_mailbox (CONTEXT *); int mbox_check_mailbox (CONTEXT *, int *); -int mbox_close_mailbox (CONTEXT *); int mbox_lock_mailbox (CONTEXT *, int, int); int mbox_parse_mailbox (CONTEXT *); int mmdf_parse_mailbox (CONTEXT *);