fs: fixup negative length in fs.truncate
`fs.ftruncate`, `fsPromises.truncate`, and `fsPromises.ftruncate` all adjust negative lengths to 0 before invoking the system call. `fs.truncate()` was the one outlier. This "fixes" https://github.com/nodejs/node/issues/35632 but in the opposite direction than discussed in the issue -- specifically by removing an EINVAL error from one function rather than adding it to another. Signed-off-by:James M Snell <jasnell@gmail.com> Fixes: https://github.com/nodejs/node/issues/35632 PR-URL: https://github.com/nodejs/node/pull/37483 Reviewed-By:
Darshan Sen <raisinten@gmail.com> Reviewed-By:
Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
parent
ee6c467c
Please register or sign in to comment