From: Lennart Poettering Date: Fri, 24 Nov 2023 09:55:19 +0000 (+0100) Subject: stat-util: make file name arguments optional in inode_same_at() X-Git-Tag: v256-rc1~1580^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a7e01542958ff341c07e36e3f0550a64779fca4;p=thirdparty%2Fsystemd.git stat-util: make file name arguments optional in inode_same_at() --- diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index c54374b2c99..1783c6eb74d 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -187,14 +187,12 @@ int inode_same_at(int fda, const char *filea, int fdb, const char *fileb, int fl struct stat a, b; assert(fda >= 0 || fda == AT_FDCWD); - assert(filea); assert(fdb >= 0 || fdb == AT_FDCWD); - assert(fileb); - if (fstatat(fda, filea, &a, flags) < 0) + if (fstatat(fda, strempty(filea), &a, flags) < 0) return log_debug_errno(errno, "Cannot stat %s: %m", filea); - if (fstatat(fdb, fileb, &b, flags) < 0) + if (fstatat(fdb, strempty(fileb), &b, flags) < 0) return log_debug_errno(errno, "Cannot stat %s: %m", fileb); return stat_inode_same(&a, &b);