]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
path-util: make path_equal_or_inode_same static inline
authorMike Yuan <me@yhndnzj.com>
Mon, 10 Jul 2023 12:42:01 +0000 (20:42 +0800)
committerMike Yuan <me@yhndnzj.com>
Tue, 11 Jul 2023 10:01:49 +0000 (18:01 +0800)
No functional change, just refactoring.

src/basic/path-util.c
src/basic/path-util.h

index b97239624911bb24f35bb1de5e3cb5ee7a19c968..f832f85c689e08f1bc80952dfd020f538fddb768 100644 (file)
@@ -485,10 +485,6 @@ int path_compare(const char *a, const char *b) {
         }
 }
 
-bool path_equal_or_inode_same(const char *a, const char *b, int flags) {
-        return path_equal(a, b) || inode_same(a, b, flags) > 0;
-}
-
 int path_compare_filename(const char *a, const char *b) {
         _cleanup_free_ char *fa = NULL, *fb = NULL;
         int r, j, k;
index af7f229908d48c49f61fce20792fd2739540bcff..97175bee11dcd496dd6176c7b8f5fb77032d66d3 100644 (file)
@@ -6,6 +6,7 @@
 #include <stddef.h>
 
 #include "macro.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "time-util.h"
@@ -77,7 +78,9 @@ static inline bool path_equal_filename(const char *a, const char *b) {
         return path_compare_filename(a, b) == 0;
 }
 
-bool path_equal_or_inode_same(const char *a, const char *b, int flags);
+static inline bool path_equal_or_inode_same(const char *a, const char *b, int flags) {
+        return path_equal(a, b) || inode_same(a, b, flags) > 0;
+}
 
 char* path_extend_internal(char **x, ...);
 #define path_extend(x, ...) path_extend_internal(x, __VA_ARGS__, POINTER_MAX)