ports/lang/node/patches/patch-src_env_cc

35 lines
1,002 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: src/env.cc
--- src/env.cc.orig
+++ src/env.cc
@@ -613,29 +613,7 @@ std::unique_ptr<v8::BackingStore> Environment::release
}
std::string GetExecPath(const std::vector<std::string>& argv) {
- char exec_path_buf[2 * PATH_MAX];
- size_t exec_path_len = sizeof(exec_path_buf);
- std::string exec_path;
- if (uv_exepath(exec_path_buf, &exec_path_len) == 0) {
- exec_path = std::string(exec_path_buf, exec_path_len);
- } else if (argv.size() > 0) {
- exec_path = argv[0];
- }
-
- // On OpenBSD process.execPath will be relative unless we
- // get the full path before process.execPath is used.
-#if defined(__OpenBSD__)
- uv_fs_t req;
- req.ptr = nullptr;
- if (0 ==
- uv_fs_realpath(nullptr, &req, exec_path.c_str(), nullptr)) {
- CHECK_NOT_NULL(req.ptr);
- exec_path = std::string(static_cast<char*>(req.ptr));
- }
- uv_fs_req_cleanup(&req);
-#endif
-
- return exec_path;
+ return "${LOCALBASE}/bin/node";
}
Environment::Environment(IsolateData* isolate_data,