diff --git a/lib/fs.js b/lib/fs.js index 7b6b6d58ae31ef..56f1df576090cf 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -609,7 +609,7 @@ function writev(fd, buffers, position, callback) { callback(err, written || 0, buffers); } - validateUint32(fd, 'fd'); + validateInt32(fd, 'fd', 0); if (!isBuffersArray(buffers)) { throw new ERR_INVALID_ARG_TYPE('buffers', 'ArrayBufferView[]', buffers); @@ -634,7 +634,7 @@ Object.defineProperty(writev, internalUtil.customPromisifyArgs, { // fs.writevSync(fd, buffers[, position]); function writevSync(fd, buffers, position) { - validateUint32(fd, 'fd'); + validateInt32(fd, 'fd', 0); const ctx = {}; if (!isBuffersArray(buffers)) {