Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util/json: Use json_object_get_uint64() with uint64 support
If HAVE_JSON_U64=1, utils/json.c:display_hex() can call json_object_get_int64() on a struct json_object created with json_object_new_uint64(). In the context of 'ndctl list --regions --human', this results in a static value of 0x7fffffffffffffff being displayed for iset_id, as seen in pmem#217. Correct hex values are observed with the use of json_object_get_uint64(). To support builds against older json-c, use a new static inline function util_json_get_u64() to fallback to json_object_get_int64() if HAVE_JSON_U64=0. Link: pmem#217 Fixes: 691cd24 ("json: Add support for json_object_new_uint64()") Signed-off-by: Justin Ernst <[email protected]>
- Loading branch information