summaryrefslogtreecommitdiff
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-10 11:49:02 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-10 16:54:18 +0100
commit1677b88d01729f514dd17145e3aefaa5db6cdf95 (patch)
tree4947ab876d7c0175edc6f681e8fd0888fe8fae31 /src/fstab-generator
parent749c4c8ed1769dd5d69705f02a8319dbf6c8ff17 (diff)
downloadsystemd-1677b88d01729f514dd17145e3aefaa5db6cdf95.tar.gz
fstab-generator: do not propagate error if we fail to canonicalize
r is used for the return value of the function, so we shouldn't use it a non-fatal check.
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 0910a9aa61..7cb4ea286d 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -611,11 +611,11 @@ static int parse_fstab(bool initrd) {
* /etc/fstab. So we canonicalize here. Note that we use CHASE_NONEXISTENT to handle the case
* where a symlink refers to another mount target; this works assuming the sub-mountpoint
* target is the final directory. */
- r = chase_symlinks(where, initrd ? "/sysroot" : NULL,
+ k = chase_symlinks(where, initrd ? "/sysroot" : NULL,
CHASE_PREFIX_ROOT | CHASE_NONEXISTENT,
&canonical_where, NULL);
- if (r < 0) /* If we can't canonicalize we continue on as if it wasn't a symlink */
- log_debug_errno(r, "Failed to read symlink target for %s, ignoring: %m", where);
+ if (k < 0) /* If we can't canonicalize we continue on as if it wasn't a symlink */
+ log_debug_errno(k, "Failed to read symlink target for %s, ignoring: %m", where);
else if (streq(canonical_where, where)) /* If it was fully canonicalized, suppress the change */
canonical_where = mfree(canonical_where);
else