freebsd-ports/devel/electron26/files/patch-content_zygote_zygote__main__linux.cc
Hiroki Tagato 9ad5184453 devel/electron26: add port: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Build cross platform desktop apps with JavaScript, HTML, and CSS.

It's easier than you think.

If you can build a website, you can build a desktop app. Electron is a
framework for creating native applications with web technologies like
JavaScript, HTML, and CSS. It takes care of the hard parts so you can
focus on the core of your application.

WWW: https://electronjs.org/
2023-10-06 18:26:35 +09:00

58 lines
1.6 KiB
C++

--- content/zygote/zygote_main_linux.cc.orig 2023-05-25 00:41:55 UTC
+++ content/zygote/zygote_main_linux.cc
@@ -11,7 +11,9 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>
+#if !defined(OS_BSD)
#include <sys/prctl.h>
+#endif
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
@@ -41,7 +43,9 @@
#include "sandbox/linux/services/thread_helpers.h"
#include "sandbox/linux/suid/client/setuid_sandbox_client.h"
#include "sandbox/policy/linux/sandbox_debug_handling_linux.h"
+#if !defined(OS_BSD)
#include "sandbox/policy/linux/sandbox_linux.h"
+#endif
#include "sandbox/policy/sandbox.h"
#include "sandbox/policy/switches.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
@@ -50,11 +54,13 @@ namespace content {
namespace {
+#if !defined(OS_BSD)
void CloseFds(const std::vector<int>& fds) {
for (const auto& it : fds) {
PCHECK(0 == IGNORE_EINTR(close(it)));
}
}
+#endif
base::OnceClosure ClosureFromTwoClosures(base::OnceClosure one,
base::OnceClosure two) {
@@ -157,9 +163,11 @@ static void EnterLayerOneSandbox(sandbox::policy::Sand
CHECK(!using_layer1_sandbox);
}
}
+#endif
bool ZygoteMain(
std::vector<std::unique_ptr<ZygoteForkDelegate>> fork_delegates) {
+#if !defined(OS_BSD)
sandbox::SetAmZygoteOrRenderer(true, GetSandboxFD());
auto* linux_sandbox = sandbox::policy::SandboxLinux::GetInstance();
@@ -224,6 +232,9 @@ bool ZygoteMain(
// This function call can return multiple times, once per fork().
return zygote.ProcessRequests();
+#else
+ return false;
+#endif
}
} // namespace content