Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs, src, lib: fix blksize & blocks on Windows #26056

Merged
merged 1 commit into from
Feb 15, 2019

Conversation

richardlau
Copy link
Member

@richardlau richardlau commented Feb 12, 2019

libuv returns values for blksize and blocks on stat calls so
do not coerce them into undefined on Windows.

Fixes: #25913

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Feb 12, 2019
@richardlau
Copy link
Member Author

@richardlau richardlau added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 12, 2019
@richardlau
Copy link
Member Author

FreeBSD failure is infrastructure: nodejs/build#1682

@joyeecheung
Copy link
Member

Looks like the previous behavior was to return undefined in fs.watchFile call stat objects on Windows when there was an error so that users can check for errors
ed85c95

@richardlau
Copy link
Member Author

Looks like the previous behavior was to return undefined in fs.watchFile call stat objects on Windows when there was an error so that users can check for errors
ed85c95

I see no reason for Windows to differ from the other platforms with regard to 0 vs undefined. I've pushed an update to the documentation (thank you, I hadn't spotted it).

@richardlau
Copy link
Member Author

@richardlau
Copy link
Member Author

richardlau commented Feb 13, 2019

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If this has been broken for so long without being noticed, it's probably to leave this as a semver-patch.

libuv returns values for `blksize` and `blocks` on stat calls so
do not coerce them into `undefined` on Windows.

PR-URL: nodejs#26056
Fixes: nodejs#25913
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@richardlau richardlau merged commit 51d20b6 into nodejs:master Feb 15, 2019
targos pushed a commit that referenced this pull request Feb 15, 2019
libuv returns values for `blksize` and `blocks` on stat calls so
do not coerce them into `undefined` on Windows.

PR-URL: #26056
Fixes: #25913
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Feb 26, 2019
rvagg pushed a commit that referenced this pull request Feb 28, 2019
libuv returns values for `blksize` and `blocks` on stat calls so
do not coerce them into `undefined` on Windows.

PR-URL: #26056
Fixes: #25913
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on Win10, fs.stat() returns a stats with undefined blksize and blocks
7 participants