]> git.ipfire.org Git - thirdparty/systemd.git/commit
json-util: add json_dispatch_job_id() dispatcher for job IDs
authorIvan Kruglov <mail@ikruglov.com>
Fri, 15 May 2026 10:16:00 +0000 (03:16 -0700)
committerIvan Kruglov <mail@ikruglov.com>
Mon, 18 May 2026 07:33:47 +0000 (00:33 -0700)
commit2d4f2441f5c6331efbfa07d06467398f582d6616
tree367c952250271a84af1aebf6337084261a938f91
parentf33fa0910d7a1009f669f612037a0453904bb643
json-util: add json_dispatch_job_id() dispatcher for job IDs

Job IDs are uint32_t values that are always >= 1 (the manager's ID counter starts at 1 and wraps from UINT32_MAX back to 1, never assigning 0). Add a dedicated dispatch function that validates this constraint, rejecting 0 and treating null as "unset" (0).

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
src/libsystemd/sd-json/json-util.c
src/libsystemd/sd-json/json-util.h
src/libsystemd/sd-json/test-json.c