]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: rename CHASE_NON_EXISTING → CHASE_NONEXISTENT 4694/head
authorLennart Poettering <lennart@poettering.net>
Thu, 1 Dec 2016 11:49:23 +0000 (12:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 1 Dec 2016 11:49:55 +0000 (12:49 +0100)
As suggested by @keszybz

src/basic/fs-util.c
src/basic/fs-util.h
src/nspawn/nspawn-mount.c
src/nspawn/nspawn.c
src/test/test-fs-util.c

index 0ca4656fdda1094b4fcc3e475629b03f1623dbd5..b30cec4f925154ae96d7142441b12d1a5887226c 100644 (file)
@@ -711,10 +711,10 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags,
                 if (child < 0) {
 
                         if (errno == ENOENT &&
-                            (flags & CHASE_NON_EXISTING) &&
+                            (flags & CHASE_NONEXISTENT) &&
                             (isempty(todo) || path_is_safe(todo))) {
 
-                                /* If CHASE_NON_EXISTING is set, and the path does not exist, then that's OK, return
+                                /* If CHASE_NONEXISTENT is set, and the path does not exist, then that's OK, return
                                  * what we got so far. But don't allow this if the remaining path contains "../ or "./"
                                  * or something else weird. */
 
index 3931534a428f068e78afcd849e07799cd7a27e05..0d925c6b84db82250601e3a21fe6cc1cfc5d8c04 100644 (file)
@@ -80,7 +80,7 @@ int inotify_add_watch_fd(int fd, int what, uint32_t mask);
 
 enum {
         CHASE_PREFIX_ROOT = 1,   /* If set, the specified path will be prefixed by the specified root before beginning the iteration */
-        CHASE_NON_EXISTING = 2,  /* If set, it's OK if the path doesn't actually exist. */
+        CHASE_NONEXISTENT = 2,   /* If set, it's OK if the path doesn't actually exist. */
 };
 
 int chase_symlinks(const char *path_with_prefix, const char *root, unsigned flags, char **ret);
index 9024ea1385c169896e6014add70f6f681acc2c3e..c9d5ac419ea3ff7fb25a4bf7bdd9cd7ce772b91c 100644 (file)
@@ -587,7 +587,7 @@ int mount_all(const char *dest,
                 if (!ro && (bool)(mount_table[k].mount_settings & MOUNT_APPLY_APIVFS_RO))
                         continue;
 
-                r = chase_symlinks(mount_table[k].where, dest, CHASE_NON_EXISTING|CHASE_PREFIX_ROOT, &where);
+                r = chase_symlinks(mount_table[k].where, dest, CHASE_NONEXISTENT|CHASE_PREFIX_ROOT, &where);
                 if (r < 0)
                         return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, mount_table[k].where);
 
@@ -686,7 +686,7 @@ static int mount_bind(const char *dest, CustomMount *m) {
         if (stat(m->source, &source_st) < 0)
                 return log_error_errno(errno, "Failed to stat %s: %m", m->source);
 
-        r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NON_EXISTING, &where);
+        r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NONEXISTENT, &where);
         if (r < 0)
                 return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, m->destination);
         if (r > 0) { /* Path exists already? */
@@ -748,7 +748,7 @@ static int mount_tmpfs(
         assert(dest);
         assert(m);
 
-        r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NON_EXISTING, &where);
+        r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NONEXISTENT, &where);
         if (r < 0)
                 return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, m->destination);
         if (r == 0) { /* Doesn't exist yet? */
@@ -789,7 +789,7 @@ static int mount_overlay(const char *dest, CustomMount *m) {
         assert(dest);
         assert(m);
 
-        r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NON_EXISTING, &where);
+        r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NONEXISTENT, &where);
         if (r < 0)
                 return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, m->destination);
         if (r == 0) { /* Doesn't exist yet? */
index 84c213785c1eac51336aa14bb1bd308a1e69957b..ddd6a64ec6669027ef55f773263564322d2c3494 100644 (file)
@@ -4135,7 +4135,7 @@ int main(int argc, char *argv[]) {
                         remove_directory = true;
 
                 } else {
-                        r = chase_symlinks_and_update(&arg_directory, arg_template ? CHASE_NON_EXISTING : 0);
+                        r = chase_symlinks_and_update(&arg_directory, arg_template ? CHASE_NONEXISTENT : 0);
                         if (r < 0)
                                 goto finish;
 
index 2570bc5859a8b808f13c0f4aa2ed18ccd5edca5f..b502cd0ad181909c94be5982b9cd2cb78935f299 100644 (file)
@@ -72,7 +72,7 @@ static void test_chase_symlinks(void) {
 
         q = strjoina(temp, "/usr");
 
-        r = chase_symlinks(p, temp, CHASE_NON_EXISTING, &result);
+        r = chase_symlinks(p, temp, CHASE_NONEXISTENT, &result);
         assert_se(r == 0);
         assert_se(path_equal(result, q));
 
@@ -162,7 +162,7 @@ static void test_chase_symlinks(void) {
         r = chase_symlinks(p, NULL, 0, &result);
         assert_se(r == -ENOENT);
 
-        r = chase_symlinks(p, NULL, CHASE_NON_EXISTING, &result);
+        r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
         assert_se(r == 0);
         assert_se(path_equal(result, p));
         result = mfree(result);
@@ -171,7 +171,7 @@ static void test_chase_symlinks(void) {
         r = chase_symlinks(p, NULL, 0, &result);
         assert_se(r == -ENOENT);
 
-        r = chase_symlinks(p, NULL, CHASE_NON_EXISTING, &result);
+        r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
         assert_se(r == 0);
         assert_se(path_equal(result, p));
         result = mfree(result);
@@ -182,7 +182,7 @@ static void test_chase_symlinks(void) {
         r = chase_symlinks(p, NULL, 0, &result);
         assert_se(r == -ENOENT);
 
-        r = chase_symlinks(p, NULL, CHASE_NON_EXISTING, &result);
+        r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
         assert_se(r == -ENOENT);
 
         assert_se(rm_rf(temp, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0);