From: Daan De Meyer Date: Thu, 1 Jun 2023 11:56:05 +0000 (+0200) Subject: fs-util: Allow passing NULL path to xopenat() X-Git-Tag: v254-rc1~269^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23e335784232015dc4b903408903737089a6283b;p=thirdparty%2Fsystemd.git fs-util: Allow passing NULL path to xopenat() 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(). --- diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 78e92609c6b..1cf0f5b945e 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -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));