Skip to content

Commit

Permalink
fixup! fixup! fs: check closing_ in FileHandle::Close
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Jul 20, 2021
1 parent e673cc7 commit 72a4621
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,10 @@ ShutdownWrap* FileHandle::CreateShutdownWrap(Local<Object> object) {
}

int FileHandle::DoShutdown(ShutdownWrap* req_wrap) {
if (closing_ || closed_)
return 0;
if (closing_ || closed_) {
req_wrap->Done(0);
return 1;
}
FileHandleCloseWrap* wrap = static_cast<FileHandleCloseWrap*>(req_wrap);
closing_ = true;
CHECK_NE(fd_, -1);
Expand Down

0 comments on commit 72a4621

Please sign in to comment.