aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-13 12:42:21 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-13 12:42:21 -0700
commitd2317359b2bb02ed4c8f773867c470c5a92a181e (patch)
tree664f0e5dab6fba70c32ddbad3ee3c6859323202f /src/library.js
parent673ea2ec24decdcfd5321f13dd68603b158dc5c5 (diff)
parentc711f1e6e6d294200b04ad580827358b2ffa2374 (diff)
Merge pull request #1374 from inolen/posix_fallocate_fix
check write permission in posix_fallocate
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index 3597891e..f9cfe68f 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1379,7 +1379,7 @@ LibraryManager.library = {
posix_fallocate: function(fd, offset, len) {
// int posix_fallocate(int fd, off_t offset, off_t len);
// http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_fallocate.html
- if (!FS.streams[fd] || FS.streams[fd].link ||
+ if (!FS.streams[fd] || !FS.streams[fd].isWrite || FS.streams[fd].link ||
FS.streams[fd].isFolder || FS.streams[fd].isDevice) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;