diff options
author | eldritch horrors <pennae@lix.systems> | 2024-04-05 21:15:22 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-06-23 11:52:49 +0000 |
commit | ce6cb14995e869cfea395570ccb300b0369c72dc (patch) | |
tree | b1fff5058c8996bc7493eba48f1d5aae2b397670 /src/libutil/namespaces.cc | |
parent | 3d155fc509e19354ba3798b1cc1b9cbcdb789c85 (diff) |
libutil: return Pid from startProcess, not pid_t
Change-Id: Icc8a15090c77f54ea7d9220aadedcd4a19922814
Diffstat (limited to 'src/libutil/namespaces.cc')
-rw-r--r-- | src/libutil/namespaces.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/namespaces.cc b/src/libutil/namespaces.cc index 4b7a1b577..247fba2c4 100644 --- a/src/libutil/namespaces.cc +++ b/src/libutil/namespaces.cc @@ -94,7 +94,7 @@ bool userNamespacesSupported() static auto res = [&]() -> bool { try { - Pid pid{startProcess([&]() { _exit(0); }, {.cloneFlags = CLONE_NEWUSER})}; + Pid pid = startProcess([&]() { _exit(0); }, {.cloneFlags = CLONE_NEWUSER}); auto r = pid.wait(); assert(!r); @@ -115,7 +115,7 @@ bool mountAndPidNamespacesSupported() { try { - Pid pid{startProcess([&]() { + Pid pid = startProcess([&]() { /* Make sure we don't remount the parent's /proc. */ if (mount(0, "/", 0, MS_PRIVATE | MS_REC, 0) == -1) _exit(1); @@ -130,7 +130,7 @@ bool mountAndPidNamespacesSupported() _exit(0); }, { .cloneFlags = CLONE_NEWNS | CLONE_NEWPID | (userNamespacesSupported() ? CLONE_NEWUSER : 0) - })}; + }); if (pid.wait()) { debug("PID namespaces do not work on this system: cannot remount /proc"); |