Skip to content

Commit 0e9d2b8

Browse files
RaisinTenmscdex
andauthored
fixup! fs: allow passing negative zero fd
Co-authored-by: mscdex <mscdex@users.noreply.github.com>
1 parent e496cc0 commit 0e9d2b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/fs/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ const getValidatedPath = hideStackFrames((fileURLOrPath, propName = 'path') => {
652652

653653
const getValidatedFd = hideStackFrames((fd, propName = 'fd') => {
654654
if (ObjectIs(fd, -0)) {
655-
fd = 0;
655+
return 0;
656656
}
657657

658658
validateInt32(fd, propName, 0);

0 commit comments

Comments
 (0)