fs: properly handle fd passed to truncate()
authorBruno Jouhier <bjouhier@gmail.com>
Sat, 7 Feb 2015 18:27:20 +0000 (19:27 +0100)
committercjihrig <cjihrig@gmail.com>
Sat, 21 Feb 2015 17:13:21 +0000 (12:13 -0500)
commitc82e580a5019b460350457198054e41dfaa5fc0c
tree13de38e7b272a0a4e07baa8f82bf059cd8a4f8b1
parent4fcbb8aaaf32e57d5ec1c23460c0d2c86da4fe6e
fs: properly handle fd passed to truncate()

Currently, fs.truncate() silently fails when a file descriptor
is passed as the first argument. This commit changes this
behavior to properly call fs.ftruncate().

PR-URL: https://github.com/joyent/node/pull/9161
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Conflicts:
lib/fs.js
doc/api/fs.markdown
lib/fs.js
test/parallel/test-fs-truncate-fd.js [new file with mode: 0644]