File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ diff -Naur node-v0.10.26.old/lib/fs.js node-v0.10.26/lib/fs.js
2
+ --- node-v0.10.26.old/lib/fs.js 2014-02-19 00:34:29.000000000 +0100
3
+ +++ node-v0.10.26/lib/fs.js 2017-12-16 00:54:39.000000000 +0100
4
+ @@ -209,7 +209,7 @@
5
+
6
+ fs.fstat(fd, function(er, st) {
7
+ if (er) return callback(er);
8
+ - size = st.size;
9
+ + size = st.isFile() ? st.size : 0;
10
+ if (size === 0) {
11
+ // the kernel lies about many files.
12
+ // Go ahead and try to read some bytes.
13
+ @@ -283,10 +283,12 @@
14
+ var flag = options.flag || 'r';
15
+ var fd = fs.openSync(path, flag, 438 /*=0666*/);
16
+
17
+ + var st;
18
+ var size;
19
+ var threw = true;
20
+ try {
21
+ - size = fs.fstatSync(fd).size;
22
+ + st = fs.fstatSync(fd);
23
+ + size = st.isFile() ? st.size : 0;
24
+ threw = false;
25
+ } finally {
26
+ if (threw) fs.closeSync(fd);
You can’t perform that action at this time.
0 commit comments