Merge pull request #28344 from YHNdnzj/compare-device-node

hibernate-resume: add & use devnode_same to compare device nodes
This commit is contained in:
Lennart Poettering
2023-07-12 17:59:28 +02:00
committed by GitHub
5 changed files with 44 additions and 8 deletions
-4
View 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;
+4 -1
View 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)