lib: set process.execPath on OpenBSD

PR-URL: https://github.com/nodejs/node/pull/18543
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Aaron Bieber authored and Myles Borins committed 2018-04-13 00:00:56 -04:00
1 parent f4ddaaec0e
commit 9129bc4fde
1 file changed
+7
+7
View File
@@ -71,6 +71,13 @@
// URL::ToObject() method is used.
NativeModule.require('internal/url');
// On OpenBSD process.execPath will be relative unless we
// get the full path before process.execPath is used.
if (process.platform === 'openbsd') {
const { realpathSync } = NativeModule.require('fs');
process.execPath = realpathSync.native(process.execPath);
}
Object.defineProperty(process, 'argv0', {
enumerable: true,
configurable: false,