# HG changeset patch
# User Damien Riegel <[email protected]>
# Date 1462471894 14400
#      Thu May 05 14:11:34 2016 -0400
# Node ID ee1d9e055d02d95b79ae66328ce64aa0cd61b2fd
# Parent  9647c02fb006c1943083071bd4f6b9c01453092c
add a stub mbox_close_mailbox function

This function does nothing, the main purpose is to introduce a mx_ops
structure for mbox, so its usage is similar to mh/imap/pop. We reuse the
name that was made available by the previous commmit.

Note that the actual closing of the descriptor is done in mx.c.

diff -r 9647c02fb006 -r ee1d9e055d02 mbox.c
--- a/mbox.c    Wed May 04 17:36:23 2016 -0400
+++ b/mbox.c    Thu May 05 14:11:34 2016 -0400
@@ -435,11 +435,18 @@
   else
     rc = -1;
 
+  ctx->mx_ops = &mx_mbox_ops;
+
   mbox_unlock_mailbox (ctx);
   mutt_unblock_signals ();
   return (rc);
 }
 
+static int mbox_close_mailbox (CONTEXT *ctx)
+{
+  return 0;
+}
+
 /* return 1 if address lists are strictly identical */
 static int strict_addrcmp (const ADDRESS *a, const ADDRESS *b)
 {
@@ -1257,3 +1264,7 @@
 
   return ((st.st_size == 0));
 }
+
+struct mx_ops mx_mbox_ops = {
+  .close = mbox_close_mailbox,
+};
diff -r 9647c02fb006 -r ee1d9e055d02 mx.h
--- a/mx.h      Wed May 04 17:36:23 2016 -0400
+++ b/mx.h      Thu May 05 14:11:34 2016 -0400
@@ -81,6 +81,7 @@
 int mx_lock_file (const char *, int, int, int, int);
 int mx_unlock_file (const char *path, int fd, int dot);
 
+extern struct mx_ops mx_mbox_ops;
 extern struct mx_ops mx_mh_ops;
 
 #endif

Reply via email to