Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Fix" repl race condition #1677

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
@bnoordhuis: use "wx" for writing temp file
  • Loading branch information
chrisdickinson committed May 12, 2015

Verified

This commit was signed with the committer’s verified signature.
ruyadorno Ruy Adorno
commit e4f0cfc988a358e70978238b7fca0715cebfeb68
2 changes: 1 addition & 1 deletion lib/internal/repl.js
Original file line number Diff line number Diff line change
@@ -164,7 +164,7 @@ function getTMPFile(ready) {
return ready(new Error('no tmpdir available'));
}
tmpPath = path.join(tmpPath, process.pid + '-' + 'repl.tmp');
Copy link
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
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);
}