generator/daemon: Don't truncate 64 bit results from OCaml functions

Commit d5b6f1df5f ("daemon: Allow parts of the daemon and APIs to be
written in OCaml.", 2017) contained a bug where in any OCaml function
that returns int64_t, the result was truncated to an int.  This
particularly affected part_get_gpt_attributes as that returns large 64
bit numbers, but probably affects other functions too, undetected.

Fixes: commit d5b6f1df5f
(cherry picked from commit 882ef4d93a)
This commit is contained in:
Richard W.M. Jones
2024-06-28 09:39:59 +01:00
parent 537b8aa687
commit 285b8fa92b

View File

@@ -835,7 +835,7 @@ let generate_daemon_caml_stubs () =
| RInt _ ->
pr " CAMLreturnT (int, Int_val (retv));\n"
| RInt64 _ ->
pr " CAMLreturnT (int, Int64_val (retv));\n"
pr " CAMLreturnT (int64_t, Int64_val (retv));\n"
| RBool _ ->
pr " CAMLreturnT (int, Bool_val (retv));\n"
| RConstString _ -> assert false