From 9d39e18c6d0ff236aa2688be63312b39dfbec52c Mon Sep 17 00:00:00 2001 From: Onne Date: Thu, 19 Nov 2009 19:12:42 +0100 Subject: [PATCH] fixes lib/file.js write, it doesnt allways emit errors or success --- lib/file.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/file.js b/lib/file.js index 84a09a8b45..fdb7e25fef 100644 --- 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)); }