]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-json: accept NULL path in sd_json_parse_file_at() too
authorMike Yuan <me@yhndnzj.com>
Mon, 3 Nov 2025 21:06:53 +0000 (22:06 +0100)
committerMike Yuan <me@yhndnzj.com>
Mon, 3 Nov 2025 21:32:57 +0000 (22:32 +0100)
src/libsystemd/sd-json/sd-json.c

index 776df25b8e783acfc213fe5e69f574e5a38823b1..c2da6bca07c8270726ba8d156190a6dc84fe841f 100644 (file)
@@ -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;