mirror of https://github.com/nodejs/node.git
fs: fix stat() reporting for large files
Use Number::New(), not Integer::New(). Large values won't fit in an Integer. Apply to the size, ino and blocks fields.v0.8.16-release
parent
8ca44f9928
commit
ec03c47c19
|
@ -321,15 +321,25 @@ Local<Object> BuildStatsObject(const uv_statbuf_t* s) {
|
|||
stats->Set(name##_symbol, val); \
|
||||
}
|
||||
X(dev)
|
||||
X(ino)
|
||||
X(mode)
|
||||
X(nlink)
|
||||
X(uid)
|
||||
X(gid)
|
||||
X(rdev)
|
||||
X(size)
|
||||
# if defined(__POSIX__)
|
||||
X(blksize)
|
||||
# endif
|
||||
#undef X
|
||||
|
||||
#define X(name) \
|
||||
{ \
|
||||
Local<Value> val = Number::New(static_cast<double>(s->st_##name)); \
|
||||
if (val.IsEmpty()) return Local<Object>(); \
|
||||
stats->Set(name##_symbol, val); \
|
||||
}
|
||||
X(ino)
|
||||
X(size)
|
||||
# if defined(__POSIX__)
|
||||
X(blocks)
|
||||
# endif
|
||||
#undef X
|
||||
|
|
Loading…
Reference in New Issue