diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-05 21:50:45 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-05 21:50:45 -0700 |
commit | e9624929302ad7f10d38a8de21dd0d7f5aa1f675 (patch) | |
tree | d3ba5e61079ba13e3bc1de30713398e5f0cc1733 /src/library.js | |
parent | 5adf7fcf23da86a26e7b3976872440c97494d1b4 (diff) | |
parent | ac21f0bddcdac04ff17cf60209a934dc222327d3 (diff) |
Merge pull request #1581 from inolen/rwfile
added read/writeFile helpers, updated tests to use new FS APIs
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/library.js b/src/library.js index c5880785..f3c3c1ec 100644 --- a/src/library.js +++ b/src/library.js @@ -323,10 +323,16 @@ LibraryManager.library = { path = Pointer_stringify(path); // we don't want this in the JS API as the JS API // uses mknod to create all nodes. - var err = FS.mayMknod(mode); - if (err) { - ___setErrNo(err); - return -1; + switch (mode & {{{ cDefine('S_IFMT') }}}) { + case {{{ cDefine('S_IFREG') }}}: + case {{{ cDefine('S_IFCHR') }}}: + case {{{ cDefine('S_IFBLK') }}}: + case {{{ cDefine('S_IFIFO') }}}: + case {{{ cDefine('S_IFSOCK') }}}: + break; + default: + ___setErrNo(ERRNO_CODES.EINVAL); + return -1; } try { FS.mknod(path, mode, dev); |