# HG changeset patch
# User Damien Riegel <[email protected]>
# Date 1462465876 14400
#      Thu May 05 12:31:16 2016 -0400
# Node ID 54af62db9cf839c6c1cc3cd4978e7e0dedb65693
# Parent  b5372bf0c6f4fb1e3d8eb9c4ec3ff70dc8a59896
mbox: populate probe callback

For now, we rely on mx_get_magic to not make the implementation too
cumbersome. The point is to get rid of this "magic" anyway.

diff -r b5372bf0c6f4 -r 54af62db9cf8 mbox.c
--- a/mbox.c    Thu May 05 12:30:00 2016 -0400
+++ b/mbox.c    Thu May 05 12:31:16 2016 -0400
@@ -411,12 +411,18 @@
 
 #undef PREV
 
+static int mbox_probe(const char *path)
+{
+  return mx_get_magic(path) == M_MBOX;
+}
+
 static int mbox_close_mailbox (CONTEXT *ctx)
 {
   return 0;
 }
 
 struct mx_ops mx_mbox_ops = {
+  .probe = mbox_probe,
   .close = mbox_close_mailbox,
 };
 

Reply via email to