Skip to content

Commit

Permalink
fs: fix not found close creation context
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Jul 17, 2024
1 parent fcda284 commit ba28d34
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/internal/fs/read/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const {

const { Buffer } = require('buffer');

const { FSReqCallback, close, read } = internalBinding('fs');
const binding = internalBinding('fs');

const {
AbortError,
Expand Down Expand Up @@ -102,11 +102,11 @@ class ReadFileContext {
length = MathMin(kReadFileBufferLength, this.size - this.pos);
}

const req = new FSReqCallback();
const req = new binding.FSReqCallback();
req.oncomplete = readFileAfterRead;
req.context = this;

read(this.fd, buffer, offset, length, -1, req);
binding.read(this.fd, buffer, offset, length, -1, req);
}

close(err) {
Expand All @@ -117,12 +117,12 @@ class ReadFileContext {
return;
}

const req = new FSReqCallback();
const req = new binding.FSReqCallback();
req.oncomplete = readFileAfterClose;
req.context = this;
this.err = err;

close(this.fd, req);
binding.close(this.fd, req);
}
}

Expand Down

0 comments on commit ba28d34

Please sign in to comment.