diff options
Diffstat (limited to 'lib/os.js')
-rw-r--r-- | lib/os.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -21,7 +21,7 @@ 'use strict'; -const { pushValToArrayMax } = process.binding('util'); +const { pushValToArrayMax, safeGetenv } = process.binding('util'); const constants = process.binding('constants').os; const { deprecate } = require('internal/util'); const { getCIDRSuffix } = require('internal/os'); @@ -127,9 +127,9 @@ function tmpdir() { if (path.length > 1 && path.endsWith('\\') && !path.endsWith(':\\')) path = path.slice(0, -1); } else { - path = process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || + path = safeGetenv('TMPDIR') || + safeGetenv('TMP') || + safeGetenv('TEMP') || '/tmp'; if (path.length > 1 && path.endsWith('/')) path = path.slice(0, -1); |