From 1062a885a9a8ebdbcac3a9e768b8f2ab87099962 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 19 Jul 2017 23:11:12 +0300 Subject: [PATCH] lib-storage: mailbox_watch_extract_notify_fd() - give better reason if mailbox has no IOs This happens currently with virtual mailboxes. --- src/lib-storage/mailbox-watch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/mailbox-watch.c b/src/lib-storage/mailbox-watch.c index a035f6e216..19f23c7dc7 100644 --- a/src/lib-storage/mailbox-watch.c +++ b/src/lib-storage/mailbox-watch.c @@ -140,7 +140,10 @@ int mailbox_watch_extract_notify_fd(struct mailbox *box, const char **reason_r) } if (failed) ret = -1; - else { + else if (array_count(&temp_ios) == 0) { + *reason_r = "Mailbox has no IO notifications"; + ret = -1; + } else { ret = io_loop_extract_notify_fd(ioloop); if (ret == -1) *reason_r = "Couldn't extra notify fd";