From: Alex Richardson Date: Wed, 8 Sep 2021 11:57:03 +0000 (+0100) Subject: audit_logging.c: fix compilation on macOS X-Git-Tag: ldb-2.5.0~483 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3675e66fe8eec15076c6b88e47b627ee80c6f9e;p=thirdparty%2Fsamba.git audit_logging.c: fix compilation on macOS On macOS tv_usec is an int so failus the build with -Werror,-Wformat. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14862 Signed-off-by: Alex Richardson Reviewed-by: Andrew Bartlett Reviewed-by: Jeremy Allison --- diff --git a/lib/audit_logging/audit_logging.c b/lib/audit_logging/audit_logging.c index 9fe2d3ba45d..87378e1bb95 100644 --- a/lib/audit_logging/audit_logging.c +++ b/lib/audit_logging/audit_logging.c @@ -70,7 +70,7 @@ char* audit_get_timestamp(TALLOC_CTX *frame) strftime(buffer, sizeof(buffer)-1, "%a, %d %b %Y %H:%M:%S", tm_info); strftime(tz, sizeof(tz)-1, "%Z", tm_info); - ts = talloc_asprintf(frame, "%s.%06ld %s", buffer, tv.tv_usec, tz); + ts = talloc_asprintf(frame, "%s.%06ld %s", buffer, (long)tv.tv_usec, tz); if (ts == NULL) { DBG_ERR("Out of memory formatting time stamp\n"); }