aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/library.js b/src/library.js
index 815badc1..9e78db13 100644
--- a/src/library.js
+++ b/src/library.js
@@ -100,7 +100,7 @@ LibraryManager.library = {
}
var entries;
try {
- entries = FS.readdir(stream);
+ entries = FS.readdir(stream.path);
} catch (e) {
return FS.handleFSError(e);
}
@@ -478,8 +478,6 @@ LibraryManager.library = {
open: function(path, oflag, varargs) {
// int open(const char *path, int oflag, ...);
// http://pubs.opengroup.org/onlinepubs/009695399/functions/open.html
- // NOTE: This implementation tries to mimic glibc rather than strictly
- // following the POSIX standard.
var mode = {{{ makeGetValue('varargs', 0, 'i32') }}};
path = Pointer_stringify(path);
try {
@@ -7237,7 +7235,7 @@ LibraryManager.library = {
socket__deps: ['$FS', '$Sockets'],
socket: function(family, type, protocol) {
var INCOMING_QUEUE_LENGTH = 64;
- var stream = FS.createStream({
+ var info = FS.createStream({
addr: null,
port: null,
inQueue: new CircularBuffer(INCOMING_QUEUE_LENGTH),
@@ -7246,7 +7244,7 @@ LibraryManager.library = {
socket: true,
stream_ops: {}
});
- assert(stream.fd < 64); // select() assumes socket fd values are in 0..63
+ assert(info.fd < 64); // select() assumes socket fd values are in 0..63
var stream = type == {{{ cDefine('SOCK_STREAM') }}};
if (protocol) {
assert(stream == (protocol == {{{ cDefine('IPPROTO_TCP') }}})); // if stream, must be tcp
@@ -7359,8 +7357,7 @@ LibraryManager.library = {
}
};
};
-
- return stream.fd;
+ return info.fd;
},
mkport__deps: ['$Sockets'],
@@ -7454,6 +7451,7 @@ LibraryManager.library = {
buffer.set(data, info.header.byteLength);
connection.send('unreliable', buffer.buffer);
+ return ret;
},
recvmsg__deps: ['$FS', '$Sockets', 'bind', '__setErrNo', '$ERRNO_CODES', 'htons'],