Skip to content

Commit

Permalink
src: fix OpenBSD build
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
devnexen authored and targos committed Aug 2, 2019
1 parent 9dfa636 commit 1b0d67b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/debug_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@

#endif // __POSIX__

#if defined(__linux__) || defined(__sun) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__sun) || \
defined(__FreeBSD__) || defined(__OpenBSD__)
#include <link.h>
#endif // (__linux__) || defined(__sun) || defined(__FreeBSD__)
#endif // (__linux__) || defined(__sun) ||
// (__FreeBSD__) || defined(__OpenBSD__)

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

std::vector<std::string> NativeSymbolDebuggingContext::GetLoadedLibraries() {
std::vector<std::string> list;
#if defined(__linux__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
dl_iterate_phdr(
[](struct dl_phdr_info* info, size_t size, void* data) {
auto list = static_cast<std::vector<std::string>*>(data);
Expand Down
2 changes: 1 addition & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ std::string GetExecPath(const std::vector<std::string>& argv) {
uv_fs_t req;
req.ptr = nullptr;
if (0 ==
uv_fs_realpath(env->event_loop(), &req, exec_path.c_str(), nullptr)) {
uv_fs_realpath(nullptr, &req, exec_path.c_str(), nullptr)) {
CHECK_NOT_NULL(req.ptr);
exec_path = std::string(static_cast<char*>(req.ptr));
}
Expand Down
2 changes: 2 additions & 0 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,9 @@ static void PrintSystemInformation(JSONWriter* writer) {
#ifndef __sun
{"max_user_processes", RLIMIT_NPROC},
#endif
#ifndef __OpenBSD__
{"virtual_memory_kbytes", RLIMIT_AS}
#endif
};
#endif // _WIN32
writer->json_objectstart("environmentVariables");
Expand Down

0 comments on commit 1b0d67b

Please sign in to comment.