cyrus-imapd/patch-cassandane-no-syslog
Martin Osvald f8deeb399d Cassandane related improvements
Cassandane: Sync split CI test and spec file
Cassandane: Fully turn off sending messages through syslog()
  and allow syslog dependent tests to pass
Cassandane: Enable building with cld2 support to fix failing tests
2023-06-30 12:19:23 +02:00

58 lines
1.4 KiB
Plaintext

diff --git a/Cassandane/Util/Log.pm b/Cassandane/Util/Log.pm
index a44005c..5bb5710 100644
--- a/Cassandane/Util/Log.pm
+++ b/Cassandane/Util/Log.pm
@@ -51,9 +51,6 @@ our @EXPORT = qw(
my $verbose = 0;
-openlog('cassandane', '', LOG_LOCAL6)
- or die "Cannot openlog";
-
sub xlog
{
my $id;
@@ -87,7 +84,6 @@ sub xlog
else {
print STDERR "$msg\n";
}
- syslog(LOG_ERR, "$msg");
}
sub set_verbose
diff --git a/utils/syslog.c b/utils/syslog.c
index 20d3763..0238d82 100644
--- a/utils/syslog.c
+++ b/utils/syslog.c
@@ -116,14 +116,28 @@ EXPORTED void syslog(int priority, const char *format, ...)
va_start(ap, format);
fake_vsyslog(priority, format, ap);
va_end(ap);
+}
+
+EXPORTED void
+__attribute__((format(printf, 3, 4)))
+__syslog_chk(int priority, int whatever __attribute__((unused)),
+ const char *format, ...)
+{
+ va_list ap;
va_start(ap, format);
- real_vsyslog(priority, format, ap);
+ fake_vsyslog(priority, format, ap);
va_end(ap);
}
EXPORTED void vsyslog(int priority, const char *format, va_list ap)
{
fake_vsyslog(priority, format, ap);
- real_vsyslog(priority, format, ap);
+}
+
+EXPORTED void
+__attribute__((format(printf, 3, 0)))
+__vsyslog_chk(int priority, int whatever __attribute__((unused)), const char *format, va_list ap)
+{
+ fake_vsyslog(priority, format, ap);
}