From f843a37aadf2cf8e4eadbf33ea68e9b6d1733062 Mon Sep 17 00:00:00 2001 From: Jeff Terrace Date: Fri, 6 Jan 2012 20:11:40 -0500 Subject: [PATCH] Allow stream to be -1 in mmap --- src/library.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/library.js b/src/library.js index 7c7d9576f..58a48d94f 100644 --- a/src/library.js +++ b/src/library.js @@ -3177,7 +3177,10 @@ LibraryManager.library = { mmap__deps: ['$FS'], mmap: function(start, num, prot, flags, stream, offset) { - // FIXME: Leaky and non-shared. + // FIXME: Leaky and non-share + if( stream == -1) { + return allocate(num,'i8', ALLOC_NORMAL); + } var info = FS.streams[stream]; if (!info) return -1; return allocate(info.object.contents.slice(offset, offset+num),