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 <duhamelantoine1995@gmail.com>
  • Loading branch information
LiviaMedeiros and aduh95 committed May 15, 2022
1 parent f114cbb commit 11a5b35
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 11a5b35

Please sign in to comment.