smbstatus: Fix the 32-bit build on FreeBSD
authorVolker Lendecke <vl@samba.org>
Tue, 9 Aug 2022 10:42:05 +0000 (12:42 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 9 Aug 2022 20:04:26 +0000 (20:04 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug  9 20:04:26 UTC 2022 on sn-devel-184

source3/utils/status_json.c

index 69b31e27f54163a51c28bb6ee7766b6e163fb442..e2798e3e392cca60505c2b3188bb9d3770008bdf 100644 (file)
@@ -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;