freebsd-ports/devel/electron21/files/patch-base_process_process__handle__freebsd.cc
Mikael Urankar 09c1114e71 devel/electron21: 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/
2022-12-17 11:09:35 +01:00

25 lines
704 B
C++

--- base/process/process_handle_freebsd.cc.orig 2022-04-21 18:48:31 UTC
+++ base/process/process_handle_freebsd.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/process/process_handle.h"
+#include "base/files/file_util.h"
#include <limits.h>
#include <stddef.h>
@@ -15,10 +16,13 @@ namespace base {
ProcessId GetParentProcessId(ProcessHandle process) {
struct kinfo_proc info;
- size_t length;
+ size_t length = sizeof(struct kinfo_proc);
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process };
if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
+ return -1;
+
+ if (length < sizeof(struct kinfo_proc))
return -1;
return info.ki_ppid;