Skip to content

Commit 1b0d67b

Browse files
devnexentargos
authored andcommitted
src: fix OpenBSD build
PR-URL: #28384 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 9dfa636 commit 1b0d67b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/debug_utils.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626

2727
#endif // __POSIX__
2828

29-
#if defined(__linux__) || defined(__sun) || defined(__FreeBSD__)
29+
#if defined(__linux__) || defined(__sun) || \
30+
defined(__FreeBSD__) || defined(__OpenBSD__)
3031
#include <link.h>
31-
#endif // (__linux__) || defined(__sun) || defined(__FreeBSD__)
32+
#endif // (__linux__) || defined(__sun) ||
33+
// (__FreeBSD__) || defined(__OpenBSD__)
3234

3335
#ifdef __APPLE__
3436
#include <mach-o/dyld.h> // _dyld_get_image_name()
@@ -331,7 +333,7 @@ void PrintLibuvHandleInformation(uv_loop_t* loop, FILE* stream) {
331333

332334
std::vector<std::string> NativeSymbolDebuggingContext::GetLoadedLibraries() {
333335
std::vector<std::string> list;
334-
#if defined(__linux__) || defined(__FreeBSD__)
336+
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
335337
dl_iterate_phdr(
336338
[](struct dl_phdr_info* info, size_t size, void* data) {
337339
auto list = static_cast<std::vector<std::string>*>(data);

src/env.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ std::string GetExecPath(const std::vector<std::string>& argv) {
277277
uv_fs_t req;
278278
req.ptr = nullptr;
279279
if (0 ==
280-
uv_fs_realpath(env->event_loop(), &req, exec_path.c_str(), nullptr)) {
280+
uv_fs_realpath(nullptr, &req, exec_path.c_str(), nullptr)) {
281281
CHECK_NOT_NULL(req.ptr);
282282
exec_path = std::string(static_cast<char*>(req.ptr));
283283
}

src/node_report.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,9 @@ static void PrintSystemInformation(JSONWriter* writer) {
519519
#ifndef __sun
520520
{"max_user_processes", RLIMIT_NPROC},
521521
#endif
522+
#ifndef __OpenBSD__
522523
{"virtual_memory_kbytes", RLIMIT_AS}
524+
#endif
523525
};
524526
#endif // _WIN32
525527
writer->json_objectstart("environmentVariables");

0 commit comments

Comments
 (0)