From: Mike Yuan Date: Mon, 3 Nov 2025 21:06:53 +0000 (+0100) Subject: sd-json: accept NULL path in sd_json_parse_file_at() too X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89b9a68e5fe56b863e01e6f39102d9ca0a54a88e;p=thirdparty%2Fsystemd.git sd-json: accept NULL path in sd_json_parse_file_at() too --- diff --git a/src/libsystemd/sd-json/sd-json.c b/src/libsystemd/sd-json/sd-json.c index 776df25b8e7..c2da6bca07c 100644 --- a/src/libsystemd/sd-json/sd-json.c +++ b/src/libsystemd/sd-json/sd-json.c @@ -3453,10 +3453,8 @@ _public_ int sd_json_parse_file_at( if (f) r = read_full_stream(f, &text, NULL); - else if (path) - r = read_full_file_full(dir_fd, path, UINT64_MAX, SIZE_MAX, 0, NULL, &text, NULL); else - return -EINVAL; + r = read_full_file_full(dir_fd, path, UINT64_MAX, SIZE_MAX, 0, NULL, &text, NULL); if (r < 0) return r;