projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b02b54e
)
Return chunk & bytes read for posix.readSync()
author
Ryan Dahl
<ry@tinyclouds.org>
Wed, 6 Jan 2010 09:47:56 +0000
(
01:47
-0800)
committer
Ryan Dahl
<ry@tinyclouds.org>
Thu, 11 Feb 2010 23:17:32 +0000
(15:17 -0800)
src/node_file.cc
patch
|
blob
|
history
diff --git
a/src/node_file.cc
b/src/node_file.cc
index
153de75
..
16f4045
100644
(file)
--- a/
src/node_file.cc
+++ b/
src/node_file.cc
@@
-421,7
+421,10
@@
static Handle<Value> Read(const Arguments& args) {
ret = pread(fd, buf, MIN(len, READ_BUF_LEN), offset);
}
if (ret < 0) return ThrowException(errno_exception(errno));
- return scope.Close(Integer::New(ret));
+ Local<Array> a = Array::New(2);
+ a->Set(Integer::New(0), Encode(buf, ret, encoding));
+ a->Set(Integer::New(1), Integer::New(ret));
+ return scope.Close(a);
}
}