summaryrefslogtreecommitdiff
path: root/lib/internal/fs/promises.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-05-20 11:41:39 -0400
committercjihrig <cjihrig@gmail.com>2018-05-25 21:48:44 -0400
commitc700cc42da9cf73af9fec2098520a6c0a631d901 (patch)
treeb662454fe2e72ecdf82dffb34481e2839ffc809a /lib/internal/fs/promises.js
parent751a42a30f35c2d04cfb80ce2b1ebec5d040a7e1 (diff)
downloadandroid-node-v8-c700cc42da9cf73af9fec2098520a6c0a631d901.tar.gz
android-node-v8-c700cc42da9cf73af9fec2098520a6c0a631d901.tar.bz2
android-node-v8-c700cc42da9cf73af9fec2098520a6c0a631d901.zip
fs: don't limit ftruncate() length to 32 bits
The length used by ftruncate() is 64 bits in the binding layer. This commit removes the 32 bit restriction in the JS layer. PR-URL: https://github.com/nodejs/node/pull/20851 Fixes: https://github.com/nodejs/node/issues/20844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib/internal/fs/promises.js')
-rw-r--r--lib/internal/fs/promises.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js
index 9700765f08..687dfb5aea 100644
--- a/lib/internal/fs/promises.js
+++ b/lib/internal/fs/promises.js
@@ -33,7 +33,7 @@ const {
const {
isUint32,
validateAndMaskMode,
- validateInt32,
+ validateInteger,
validateUint32
} = require('internal/validators');
const pathModule = require('path');
@@ -263,7 +263,7 @@ async function truncate(path, len = 0) {
async function ftruncate(handle, len = 0) {
validateFileHandle(handle);
- validateInt32(len, 'len');
+ validateInteger(len, 'len');
len = Math.max(0, len);
return binding.ftruncate(handle.fd, len, kUsePromises);
}