Drop unnecessary path_equal_ptr() wrapper
path_equal already works with NULL pointers.
This commit is contained in:
@@ -105,10 +105,6 @@ static inline int path_simplify_alloc(const char *path, char **ret) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool path_equal_ptr(const char *a, const char *b) {
|
||||
return !!a == !!b && (!a || path_equal(a, b));
|
||||
}
|
||||
|
||||
/* Note: the search terminates on the first NULL item. */
|
||||
#define PATH_IN_SET(p, ...) path_strv_contains(STRV_MAKE(__VA_ARGS__), p)
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ int null_or_empty_path_with_root(const char *fn, const char *root) {
|
||||
* When looking under root_dir, we can't expect /dev/ to be mounted,
|
||||
* so let's see if the path is a (possibly dangling) symlink to /dev/null. */
|
||||
|
||||
if (path_equal_ptr(path_startswith(fn, root ?: "/"), "dev/null"))
|
||||
if (path_equal(path_startswith(fn, root ?: "/"), "dev/null"))
|
||||
return true;
|
||||
|
||||
r = chase_and_stat(fn, root, CHASE_PREFIX_ROOT, NULL, &st);
|
||||
|
||||
Reference in New Issue
Block a user