Skip to content

Commit bd4350c

Browse files
qbitBridgeAR
authored andcommitted
lib: set process.execPath on OpenBSD
PR-URL: nodejs#18543 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 916cfec commit bd4350c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/internal/bootstrap_node.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@
7575
// URL::ToObject() method is used.
7676
NativeModule.require('internal/url');
7777

78+
// On OpenBSD process.execPath will be relative unless we
79+
// get the full path before process.execPath is used.
80+
if (process.platform === 'openbsd') {
81+
const { realpathSync } = NativeModule.require('fs');
82+
process.execPath = realpathSync.native(process.execPath);
83+
}
84+
7885
Object.defineProperty(process, 'argv0', {
7986
enumerable: true,
8087
configurable: false,

0 commit comments

Comments
 (0)