From: Volker Lendecke Date: Tue, 9 Aug 2022 10:42:05 +0000 (+0200) Subject: smbstatus: Fix the 32-bit build on FreeBSD X-Git-Tag: talloc-2.4.0~1524 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d015b4b6db20235d6d821204d03b0e1fce1c681;p=thirdparty%2Fsamba.git smbstatus: Fix the 32-bit build on FreeBSD Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Aug 9 20:04:26 UTC 2022 on sn-devel-184 --- diff --git a/source3/utils/status_json.c b/source3/utils/status_json.c index 69b31e27f54..e2798e3e392 100644 --- a/source3/utils/status_json.c +++ b/source3/utils/status_json.c @@ -75,7 +75,8 @@ static int add_server_id_to_json(struct json_object *parent_json, goto failure; } - pid_str = talloc_asprintf(tmp_ctx, "%lu", server_id.pid); + pid_str = talloc_asprintf( + tmp_ctx, "%lu", (unsigned long)server_id.pid); result = json_add_string(&sub_json, "pid", pid_str); if (result < 0) { goto failure; @@ -90,7 +91,8 @@ static int add_server_id_to_json(struct json_object *parent_json, if (result < 0) { goto failure; } - unique_id_str = talloc_asprintf(tmp_ctx, "%lu", server_id.unique_id); + unique_id_str = talloc_asprintf( + tmp_ctx, "%"PRIu64, server_id.unique_id); result = json_add_string(&sub_json, "unique_id", unique_id_str); if (result < 0) { goto failure; @@ -834,7 +836,7 @@ static int add_open_to_json(struct json_object *parent_json, if (result < 0) { goto failure; } - share_file_id = talloc_asprintf(tmp_ctx, "%lu", e->share_file_id); + share_file_id = talloc_asprintf(tmp_ctx, "%"PRIu64, e->share_file_id); result = json_add_string(&sub_json, "share_file_id", share_file_id); if (result < 0) { goto failure; @@ -871,7 +873,7 @@ static int add_open_to_json(struct json_object *parent_json, } pid = server_id_str_buf(e->pid, &tmp); - key = talloc_asprintf(tmp_ctx, "%s/%lu", pid, e->share_file_id); + key = talloc_asprintf(tmp_ctx, "%s/%"PRIu64, pid, e->share_file_id); result = json_add_object(&opens_json, key, &sub_json); if (result < 0) { goto failure;