]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fs-util: Allow passing NULL path to xopenat()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 1 Jun 2023 11:56:05 +0000 (13:56 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 6 Jun 2023 12:42:03 +0000 (14:42 +0200)
We recently codified in the coding style that for openat() style APIs,
an empty path can be passed both as the empty string and as NULL, so
let's make sure we follow that style in xopenat().

src/basic/fs-util.c

index 78e92609c6b9a97fa6e6f75af172043b8d335569..1cf0f5b945ee9a365efb8f8ee10dc3bff8529888 100644 (file)
@@ -1097,7 +1097,6 @@ int xopenat(int dir_fd, const char *path, int open_flags, XOpenFlags xopen_flags
         int r;
 
         assert(dir_fd >= 0 || dir_fd == AT_FDCWD);
-        assert(path);
 
         if (isempty(path)) {
                 assert(!FLAGS_SET(open_flags, O_CREAT|O_EXCL));