]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
audit_logging.c: fix compilation on macOS
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Wed, 8 Sep 2021 11:57:03 +0000 (12:57 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 13 Oct 2021 01:42:35 +0000 (01:42 +0000)
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 <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/audit_logging/audit_logging.c

index 9fe2d3ba45d710a1bb9045189ae2070423b5bf15..87378e1bb95367858ab356056fea5d1797a95ce4 100644 (file)
@@ -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");
        }