Skip to content

Commit

Permalink
squash: fix race condition on closing fd
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
  • Loading branch information
LiviaMedeiros and aduh95 authored May 9, 2022
1 parent 29655bd commit 523f1b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-fs-read-position-validation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ async function testValid(position, allowedErrors = []) {
const handler = common.mustCall((err) => {
callCount--;
if (err && !allowedErrors.includes(err.code)) {
fs.close(fd, common.mustSucceed(() => reject(err)));
fs.close(fd, common.mustSucceed());
reject(err);
} else if (callCount === 0) {
fs.close(fd, common.mustSucceed(resolve));
}
Expand Down

0 comments on commit 523f1b9

Please sign in to comment.