Skip to content

Commit

Permalink
lib: set process.execPath on OpenBSD
Browse files Browse the repository at this point in the history
PR-URL: nodejs#18543
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
qbit authored and MayaLekova committed May 8, 2018
1 parent eb4de1b commit 9752795
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9752795

Please sign in to comment.