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 2018-02-03 09:52:29 -07:00 committed by Ruben Bridgewater
parent 916cfeca77
commit bd4350ca08
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -75,6 +75,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,