From 05cbdf637483157a8455f19ec37f62c22ad24e08 Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Thu, 5 Jun 2025 17:03:25 +0300 Subject: mount_bsd.c: Fix race between actual mounting and returning to the caller Signed-off-by: Gleb Popov <6yearold@gmail.com> --- lib/mount_bsd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/mount_bsd.c') diff --git a/lib/mount_bsd.c b/lib/mount_bsd.c index bd95a76..28a9ae5 100644 --- a/lib/mount_bsd.c +++ b/lib/mount_bsd.c @@ -187,7 +187,7 @@ mount: if (pid == 0) { const char *argv[32]; int a = 0; - int ret = -1; + int ret = -1; if (! fdnam) { @@ -214,6 +214,7 @@ mount: _exit(EXIT_FAILURE); } + waitpid(pid, &status, 0); _exit(EXIT_SUCCESS); } -- cgit v1.2.3