Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/library_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,12 @@ FS.staticInit();
return parent.node_ops.mknod(parent, name, mode, dev);
},
// helpers to create specific types of nodes
create(path, mode) {
mode = mode !== undefined ? mode : 438 /* 0666 */;
create(path, mode = 0o666) {
mode &= {{{ cDefs.S_IALLUGO }}};
mode |= {{{ cDefs.S_IFREG }}};
return FS.mknod(path, mode, 0);
},
mkdir(path, mode) {
mode = mode !== undefined ? mode : 511 /* 0777 */;
mkdir(path, mode = 0o777) {
mode &= {{{ cDefs.S_IRWXUGO }}} | {{{ cDefs.S_ISVTX }}};
mode |= {{{ cDefs.S_IFDIR }}};
#if FS_DEBUG
Expand All @@ -701,7 +699,7 @@ FS.staticInit();
mkdev(path, mode, dev) {
if (typeof dev == 'undefined') {
dev = mode;
mode = 438 /* 0666 */;
mode = 0o666;
}
mode |= {{{ cDefs.S_IFCHR }}};
return FS.mknod(path, mode, dev);
Expand Down Expand Up @@ -1009,13 +1007,12 @@ FS.staticInit();
timestamp: Math.max(atime, mtime)
});
},
open(path, flags, mode) {
open(path, flags, mode = 0o666) {
if (path === "") {
throw new FS.ErrnoError({{{ cDefs.ENOENT }}});
}
flags = typeof flags == 'string' ? FS_modeStringToFlags(flags) : flags;
if ((flags & {{{ cDefs.O_CREAT }}})) {
mode = typeof mode == 'undefined' ? 438 /* 0666 */ : mode;
mode = (mode & {{{ cDefs.S_IALLUGO }}}) | {{{ cDefs.S_IFREG }}};
} else {
mode = 0;
Expand Down Expand Up @@ -1381,7 +1378,7 @@ FS.staticInit();
FS.mkdir('/proc/self/fd');
FS.mount({
mount() {
var node = FS.createNode(proc_self, 'fd', {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */, {{{ cDefs.S_IXUGO }}});
var node = FS.createNode(proc_self, 'fd', {{{ cDefs.S_IFDIR }}} | {{{ 0777 }}}, {{{ cDefs.S_IXUGO }}});
node.node_ops = {
lookup(parent, name) {
var fd = +name;
Expand Down
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors1.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8450
8442
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors1.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20797
20762
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors2.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8436
8428
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors2.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20765
20730
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9477
9468
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24640
24605
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8419
8410
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20691
20656
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8419
8410
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20691
20656
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_lto.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8349
8342
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_lto.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20376
20341
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_mangle.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9480
9472
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_mangle.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24640
24605
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_noexcept.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8450
8442
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_noexcept.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20797
20762
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_files_js_fs.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7584
7580
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_files_js_fs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18694
18670