fs: properly handle fd passed to truncate()#866
Closed
cjihrig wants to merge 2 commits intonodejs:v1.xfrom
cjihrig:truncate
Closed
fs: properly handle fd passed to truncate()#866cjihrig wants to merge 2 commits intonodejs:v1.xfrom cjihrig:truncate
cjihrig wants to merge 2 commits intonodejs:v1.xfrom
cjihrig:truncate
Conversation
test/parallel/test-fs-truncate-fd.js
Outdated
Member
There was a problem hiding this comment.
Suggestion: check that the file is really truncated.
Member
|
LGTM with the remark that, ideally, the commit is split in two. It fixes two unrelated bugs now. |
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: nodejs/node-v0.x-archive#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
This commit adds proper type checking to makeCallback(). Anything other than undefined or a function will throw. PR-URL: #866 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Contributor
Author
|
@bnoordhuis added a check that the |
Contributor
There was a problem hiding this comment.
What's the point of an extra check? this function is internal anyway never mind
Contributor
|
LGTM |
cjihrig
added a commit
that referenced
this pull request
Feb 21, 2015
This commit adds proper type checking to makeCallback(). Anything other than undefined or a function will throw. PR-URL: #866 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
Contributor
Author
This was referenced Feb 23, 2015
This was referenced Nov 29, 2023
This was referenced Nov 30, 2023
This was referenced May 13, 2024
This was referenced May 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
fs.truncate()silently fails when a file descriptor is passed as the first argument. This commit changes this behavior to properly callfs.ftruncate(). This commit also adds proper type checking to the callback provided tomakeCallback().Port of nodejs/node-v0.x-archive#9161