Skip to content

Commit

Permalink
fixup! fs: improve error performance fori fsyncSync
Browse files Browse the repository at this point in the history
  • Loading branch information
pluris committed Sep 27, 2023
1 parent 19748b8 commit c710f94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/internal/fs/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ function close(fd) {
}

function fsync(fd) {
fd = getValidatedFd(fd);

return binding.fsyncSync(fd);
}

Expand Down
8 changes: 4 additions & 4 deletions typings/internalBinding/fs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ declare namespace InternalFSBinding {
function fstat(fd: number, useBigint: boolean, usePromises: typeof kUsePromises): Promise<Float64Array | BigUint64Array>;
function fstat(fd: number, useBigint: true, usePromises: typeof kUsePromises): Promise<BigUint64Array>;
function fstat(fd: number, useBigint: false, usePromises: typeof kUsePromises): Promise<Float64Array>;
function fsync(fd: number): void;

function fsyncSync(fd: number, req: FSReqCallback): void;
function fsyncSync(fd: number, req: undefined, ctx: FSSyncContext): void;
function fsyncSync(fd: number, usePromises: typeof kUsePromises): Promise<void>;
function fsync(fd: number, req: FSReqCallback): void;
function fsync(fd: number, req: undefined, ctx: FSSyncContext): void;
function fsync(fd: number, usePromises: typeof kUsePromises): Promise<void>;
function fsyncSync(fd: number): void;

function ftruncate(fd: number, len: number, req: FSReqCallback): void;
function ftruncate(fd: number, len: number, req: undefined, ctx: FSSyncContext): void;
Expand Down

0 comments on commit c710f94

Please sign in to comment.