diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-09-03 16:56:07 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-09-03 17:01:17 +0200 |
commit | 91e0b0640ec394aa7501fb2437ef545648638f18 (patch) | |
tree | 5e827d3cd8e45844c30f21f1cf4e551faabd357f /src/test/test-udev.c | |
parent | udev-test: make sure we run udev tests with selinux assumed off (diff) | |
download | systemd-91e0b0640ec394aa7501fb2437ef545648638f18.tar.xz systemd-91e0b0640ec394aa7501fb2437ef545648638f18.zip |
udev-test: use mount_verbose() instead of mount(), to make debugging easier
Diffstat (limited to 'src/test/test-udev.c')
-rw-r--r-- | src/test/test-udev.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/test/test-udev.c b/src/test/test-udev.c index a9eda10437..968bfb3238 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -17,6 +17,7 @@ #include "log.h" #include "main-func.h" #include "mkdir.h" +#include "mount-util.h" #include "namespace-util.h" #include "selinux-util.h" #include "signal-util.h" @@ -43,12 +44,12 @@ static int fake_filesystems(void) { if (r < 0) return log_error_errno(r, "Failed to detach mount namespace: %m"); - for (size_t i = 0; i < ELEMENTSOF(fakefss); i++) - if (mount(fakefss[i].src, fakefss[i].target, NULL, MS_BIND, NULL) < 0) { - log_full_errno(fakefss[i].ignore_mount_error ? LOG_DEBUG : LOG_ERR, errno, "%s: %m", fakefss[i].error); - if (!fakefss[i].ignore_mount_error) - return -errno; - } + for (size_t i = 0; i < ELEMENTSOF(fakefss); i++) { + r = mount_verbose(fakefss[i].ignore_mount_error ? LOG_NOTICE : LOG_ERR, + fakefss[i].src, fakefss[i].target, NULL, MS_BIND, NULL); + if (r < 0 && !fakefss[i].ignore_mount_error) + return r; + } return 0; } |