Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rentzsch/394401 to your computer and use it in GitHub Desktop.
Save rentzsch/394401 to your computer and use it in GitHub Desktop.
From 57c75a248546d63e4cad8a6f3306ec18f753e484 Mon Sep 17 00:00:00 2001
From: rentzsch <[email protected]>
Date: Sat, 8 May 2010 01:09:29 -0500
Subject: [PATCH] [FIX] fs.Stats.size V8::Integer => V8::Number.
While VM::Integer::Value() offers an int64_t, V8::Integer::New() only
accepts an int32_t, truncating fs.Stat's size in BuildStatsObject().
I consider this a bug in V8, and we should move back to V8::Integer
when it gets a ctr that allows a int64_t. Until then, this work-around
should hold.
---
src/node.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/node.cc b/src/node.cc
index 6e58217..e8bfcf8 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -928,7 +928,7 @@ Local<Object> BuildStatsObject(struct stat * s) {
stats->Set(rdev_symbol, Integer::New(s->st_rdev));
/* total size, in bytes */
- stats->Set(size_symbol, Integer::New(s->st_size));
+ stats->Set(size_symbol, Number::New(s->st_size));
/* blocksize for filesystem I/O */
stats->Set(blksize_symbol, Integer::New(s->st_blksize));
--
1.7.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment