Skip to content

Commit cb638b5

Browse files
committed
util-lib: rename CHASE_NON_EXISTING → CHASE_NONEXISTENT
As suggested by @keszybz
1 parent ec57bd4 commit cb638b5

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/basic/fs-util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,10 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags,
711711
if (child < 0) {
712712

713713
if (errno == ENOENT &&
714-
(flags & CHASE_NON_EXISTING) &&
714+
(flags & CHASE_NONEXISTENT) &&
715715
(isempty(todo) || path_is_safe(todo))) {
716716

717-
/* If CHASE_NON_EXISTING is set, and the path does not exist, then that's OK, return
717+
/* If CHASE_NONEXISTENT is set, and the path does not exist, then that's OK, return
718718
* what we got so far. But don't allow this if the remaining path contains "../ or "./"
719719
* or something else weird. */
720720

src/basic/fs-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int inotify_add_watch_fd(int fd, int what, uint32_t mask);
8080

8181
enum {
8282
CHASE_PREFIX_ROOT = 1, /* If set, the specified path will be prefixed by the specified root before beginning the iteration */
83-
CHASE_NON_EXISTING = 2, /* If set, it's OK if the path doesn't actually exist. */
83+
CHASE_NONEXISTENT = 2, /* If set, it's OK if the path doesn't actually exist. */
8484
};
8585

8686
int chase_symlinks(const char *path_with_prefix, const char *root, unsigned flags, char **ret);

src/nspawn/nspawn-mount.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ int mount_all(const char *dest,
587587
if (!ro && (bool)(mount_table[k].mount_settings & MOUNT_APPLY_APIVFS_RO))
588588
continue;
589589

590-
r = chase_symlinks(mount_table[k].where, dest, CHASE_NON_EXISTING|CHASE_PREFIX_ROOT, &where);
590+
r = chase_symlinks(mount_table[k].where, dest, CHASE_NONEXISTENT|CHASE_PREFIX_ROOT, &where);
591591
if (r < 0)
592592
return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, mount_table[k].where);
593593

@@ -686,7 +686,7 @@ static int mount_bind(const char *dest, CustomMount *m) {
686686
if (stat(m->source, &source_st) < 0)
687687
return log_error_errno(errno, "Failed to stat %s: %m", m->source);
688688

689-
r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NON_EXISTING, &where);
689+
r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NONEXISTENT, &where);
690690
if (r < 0)
691691
return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, m->destination);
692692
if (r > 0) { /* Path exists already? */
@@ -748,7 +748,7 @@ static int mount_tmpfs(
748748
assert(dest);
749749
assert(m);
750750

751-
r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NON_EXISTING, &where);
751+
r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NONEXISTENT, &where);
752752
if (r < 0)
753753
return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, m->destination);
754754
if (r == 0) { /* Doesn't exist yet? */
@@ -789,7 +789,7 @@ static int mount_overlay(const char *dest, CustomMount *m) {
789789
assert(dest);
790790
assert(m);
791791

792-
r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NON_EXISTING, &where);
792+
r = chase_symlinks(m->destination, dest, CHASE_PREFIX_ROOT|CHASE_NONEXISTENT, &where);
793793
if (r < 0)
794794
return log_error_errno(r, "Failed to resolve %s/%s: %m", dest, m->destination);
795795
if (r == 0) { /* Doesn't exist yet? */

src/nspawn/nspawn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4135,7 +4135,7 @@ int main(int argc, char *argv[]) {
41354135
remove_directory = true;
41364136

41374137
} else {
4138-
r = chase_symlinks_and_update(&arg_directory, arg_template ? CHASE_NON_EXISTING : 0);
4138+
r = chase_symlinks_and_update(&arg_directory, arg_template ? CHASE_NONEXISTENT : 0);
41394139
if (r < 0)
41404140
goto finish;
41414141

src/test/test-fs-util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static void test_chase_symlinks(void) {
7272

7373
q = strjoina(temp, "/usr");
7474

75-
r = chase_symlinks(p, temp, CHASE_NON_EXISTING, &result);
75+
r = chase_symlinks(p, temp, CHASE_NONEXISTENT, &result);
7676
assert_se(r == 0);
7777
assert_se(path_equal(result, q));
7878

@@ -162,7 +162,7 @@ static void test_chase_symlinks(void) {
162162
r = chase_symlinks(p, NULL, 0, &result);
163163
assert_se(r == -ENOENT);
164164

165-
r = chase_symlinks(p, NULL, CHASE_NON_EXISTING, &result);
165+
r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
166166
assert_se(r == 0);
167167
assert_se(path_equal(result, p));
168168
result = mfree(result);
@@ -171,7 +171,7 @@ static void test_chase_symlinks(void) {
171171
r = chase_symlinks(p, NULL, 0, &result);
172172
assert_se(r == -ENOENT);
173173

174-
r = chase_symlinks(p, NULL, CHASE_NON_EXISTING, &result);
174+
r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
175175
assert_se(r == 0);
176176
assert_se(path_equal(result, p));
177177
result = mfree(result);
@@ -182,7 +182,7 @@ static void test_chase_symlinks(void) {
182182
r = chase_symlinks(p, NULL, 0, &result);
183183
assert_se(r == -ENOENT);
184184

185-
r = chase_symlinks(p, NULL, CHASE_NON_EXISTING, &result);
185+
r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
186186
assert_se(r == -ENOENT);
187187

188188
assert_se(rm_rf(temp, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0);

0 commit comments

Comments
 (0)