summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2022-02-01 23:02:35 -0800
committerAndreas Kling <kling@serenityos.org>2022-02-02 11:21:43 +0100
commit8215b99df186cc70d86aa702d81b7d1a96dbd356 (patch)
tree2aebb744e5f7caccece18b400ff4f9b079afd5d9
parentd85f06299087dc939e7aeb2dc0668a01db30ad2b (diff)
downloadserenity-8215b99df186cc70d86aa702d81b7d1a96dbd356.zip
mount: Exit without error when handling mount all on system boot
At the point at which `mount -a` is executed by SystemServer, the /proc fs is not yet mounted. That means that opening /proc/fd in the `print_mounts()` function will always fail with an error. 0.976 mount(8:8): Exiting with runtime error: No such file or directory (errno=2) The fix is simple, just return gracefully after we execute mount all.
-rw-r--r--Userland/Utilities/mount.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Utilities/mount.cpp b/Userland/Utilities/mount.cpp
index 5943f91eaf..a4021b2fdd 100644
--- a/Userland/Utilities/mount.cpp
+++ b/Userland/Utilities/mount.cpp
@@ -167,8 +167,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(should_mount_all, "Mount all file systems listed in /etc/fstab", nullptr, 'a');
args_parser.parse(arguments);
- if (should_mount_all)
+ if (should_mount_all) {
TRY(mount_all());
+ return 0;
+ }
if (source.is_empty() && mountpoint.is_empty())
TRY(print_mounts());