summaryrefslogtreecommitdiff
path: root/src/shared/mount-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-23 11:34:00 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-23 11:39:45 +0200
commit45a68ed3073a006c44703acf2928be156805ef9f (patch)
tree47b390e17dab2415bf3525b71d1f5ab31bc37a07 /src/shared/mount-util.c
parent3e24e8cd647478b3d161f1887785132e334e5df5 (diff)
downloadsystemd-45a68ed3073a006c44703acf2928be156805ef9f.tar.gz
Move freeze() into shared/
Library code should not call freeze(), this is something that should only be done by "application code", so moving it into shared/ is appropriate. The fallback to call _exit() is dropped: let's trust that the infinite loop is infinite.
Diffstat (limited to 'src/shared/mount-util.c')
-rw-r--r--src/shared/mount-util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c
index 594efea989..cf8ca8d9d3 100644
--- a/src/shared/mount-util.c
+++ b/src/shared/mount-util.c
@@ -11,6 +11,7 @@
#include "alloc-util.h"
#include "dissect-image.h"
+#include "exec-util.h"
#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
@@ -1010,11 +1011,9 @@ static int make_userns(uid_t uid_shift, uid_t uid_range) {
r = safe_fork("(sd-mkuserns)", FORK_CLOSE_ALL_FDS|FORK_DEATHSIG|FORK_NEW_USERNS, &pid);
if (r < 0)
return r;
- if (r == 0) {
+ if (r == 0)
/* Child. We do nothing here, just freeze until somebody kills us. */
freeze();
- _exit(EXIT_FAILURE);
- }
xsprintf(line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, uid_shift, uid_range);