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:
686bec4
)
fixes lib/file.js write, it doesnt allways emit errors or success
author
Onne
<onne@onnlucky.com>
Thu, 19 Nov 2009 18:12:42 +0000
(19:12 +0100)
committer
Ryan Dahl
<ry@tinyclouds.org>
Thu, 19 Nov 2009 18:12:42 +0000
(19:12 +0100)
lib/file.js
patch
|
blob
|
history
diff --git
a/lib/file.js
b/lib/file.js
index
84a09a8
..
fdb7e25
100644
(file)
--- a/
lib/file.js
+++ b/
lib/file.js
@@
-29,10
+29,12
@@
exports.write = function (filename, data, encoding) {
posix.write(fd, _data, 0, encoding)
.addErrback(function () {
posix.close(fd);
+ promise.emitError();
})
.addCallback(function (written) {
if (written === _data.length) {
posix.close(fd);
+ promise.emitSuccess();
} else {
doWrite(_data.slice(written));
}