aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Feeley <mfeeley@mozilla.com>2013-06-04 15:39:55 -0700
committerMarc Feeley <mfeeley@mozilla.com>2013-06-04 15:39:55 -0700
commit9226578fa142134973e3ad5544c22cb954ea0cc2 (patch)
treee7a6fd5aa9ef0eaf6a28926922cf43b9d80db3cd /src
parentfef341fbe96eeac85c4f6592a62e11d6f7917487 (diff)
Add basic support for nonblocking read
Diffstat (limited to 'src')
-rw-r--r--src/library.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 51c4c5cb..58a4e598 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1805,6 +1805,10 @@ LibraryManager.library = {
___setErrNo(ERRNO_CODES.EIO);
return -1;
}
+ if (result === undefined && bytesRead === 0) {
+ ___setErrNo(ERRNO_CODES.EAGAIN);
+ return -1;
+ }
if (result === null || result === undefined) break;
bytesRead++;
{{{ makeSetValue('buf', 'i', 'result', 'i8') }}}