From 16ad1e7d6c6b670cae772ef904ac94f50b89c9fe Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Fri, 9 May 2025 22:47:56 +0900 Subject: mail/cyrus-imapd312: Add new port -- Cyrus IMAP 3.12 Relnotes: https://www.cyrusimap.org/3.12/imap/download/release-notes/3.12/x/3.12.0.html --- mail/cyrus-imapd312/files/patch-imap__notify.c | 48 ++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 mail/cyrus-imapd312/files/patch-imap__notify.c (limited to 'mail/cyrus-imapd312/files/patch-imap__notify.c') diff --git a/mail/cyrus-imapd312/files/patch-imap__notify.c b/mail/cyrus-imapd312/files/patch-imap__notify.c new file mode 100644 index 000000000000..e093378fc10d --- /dev/null +++ b/mail/cyrus-imapd312/files/patch-imap__notify.c @@ -0,0 +1,48 @@ +--- imap/notify.c.orig 2021-05-10 04:34:24 UTC ++++ imap/notify.c +@@ -49,6 +49,9 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++#include ++#endif + #include + #include + #include +@@ -209,6 +212,27 @@ EXPORTED void notify(const char *method, + FNAME_NOTIFY_SOCK, sizeof(sun_data.sun_path)); + } + ++#if defined(__FreeBSD__) ++ size_t maxsockbuf; ++ size_t len = sizeof(maxsockbuf); ++ r = sysctlbyname("kern.ipc.maxsockbuf", &maxsockbuf, &len, NULL, 0); ++ if (r == 0) { ++ bufsiz = MIN(maxsockbuf, NOTIFY_MAXSIZE); ++ } else { ++ syslog(LOG_WARNING, ++ "NOTIFY(%s): unable to sysctlbyname(kern.ipc.maxsockbuf): %m", ++ loginfo); ++ bufsiz = NOTIFY_MAXSIZE; ++ } ++ ++ optlen = sizeof(bufsiz); ++ r = setsockopt(soc, SOL_SOCKET, SO_SNDBUF, &bufsiz, optlen); ++ if (r == -1) { ++ syslog(LOG_WARNING, ++ "NOTIFY(%s): unable to setsockopt(SO_SNDBUF) on socket: %m", ++ loginfo); ++ } ++#else + /* Get send buffer size */ + optlen = sizeof(bufsiz); + r = getsockopt(soc, SOL_SOCKET, SO_SNDBUF, &bufsiz, &optlen); +@@ -221,6 +245,7 @@ EXPORTED void notify(const char *method, + + /* Use minimum of 1/10 of send buffer size (-overhead) NOTIFY_MAXSIZE */ + bufsiz = MIN(bufsiz / 10 - 32, NOTIFY_MAXSIZE); ++#endif + + /* + * build request of the form: -- cgit v1.2.3