summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-09-21 19:59:07 +0200
committerSven Eden <yamakuzure@gmx.net>2017-03-29 10:45:10 +0200
commit1fb205729747c2a77848d2ddf18c4ed720dc319c (patch)
tree9970906649dad8a0352e84ceac67ab7504e225b1 /src
parent3c5cadf3384cbc335697092e1fb6faba9c90b6b0 (diff)
mount: propagate error codes correctly
Make sure to propagate error codes from mount-loops correctly. Right now, we return the return-code of the first mount that did _something_. This is not what we want. Make sure we return an error if _any_ mount fails (and then make sure to return the first error to not hide proper errors due to consequential errors like -ENOTDIR). Reported by cee1 <fykcee1@gmail.com>.
Diffstat (limited to 'src')
-rw-r--r--src/core/mount-setup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 4713187e6..9c9675085 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -227,7 +227,7 @@ int mount_setup_early(void) {
int j;
j = mount_one(mount_table + i, false);
- if (r == 0)
+ if (j != 0 && r >= 0)
r = j;
}
@@ -371,7 +371,7 @@ int mount_setup(bool loaded_policy) {
int j;
j = mount_one(mount_table + i, loaded_policy);
- if (r == 0)
+ if (j != 0 && r >= 0)
r = j;
}