Skip to content
Prev Previous commit
Next Next commit
@bnoordhuis: use "wx" for writing temp file
  • Loading branch information
chrisdickinson committed May 12, 2015
commit e4f0cfc988a358e70978238b7fca0715cebfeb68
2 changes: 1 addition & 1 deletion lib/internal/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function getTMPFile(ready) {
return ready(new Error('no tmpdir available'));
}
tmpPath = path.join(tmpPath, process.pid + '-' + 'repl.tmp');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe 'node-repl-' + process.pid to make it clear which process created that file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

fs.open(tmpPath, 'w', 0o600, function(err, fd) {
fs.open(tmpPath, 'wx', 0o600, function(err, fd) {
if (err) {
return ready(err);
}
Expand Down