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
2 changes: 1 addition & 1 deletion src/library_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ FS.staticInit();
FS.mkdir('/proc/self/fd');
FS.mount({
mount() {
var node = FS.createNode(proc_self, 'fd', {{{ cDefs.S_IFDIR }}} | {{{ 0777 }}}, {{{ cDefs.S_IXUGO }}});
var node = FS.createNode(proc_self, 'fd', {{{ cDefs.S_IFDIR | 0o777 }}}, {{{ cDefs.S_IXUGO }}});
node.node_ops = {
lookup(parent, name) {
var fd = +name;
Expand Down
4 changes: 2 additions & 2 deletions src/library_lz4.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
addToLibrary({
$LZ4__deps: ['$FS', '$preloadPlugins'],
$LZ4: {
DIR_MODE: {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */,
FILE_MODE: {{{ cDefs.S_IFREG }}} | 511 /* 0777 */,
DIR_MODE: {{{ cDefs.S_IFDIR | 0o777 }}},
FILE_MODE: {{{ cDefs.S_IFREG | 0o777 }}},
CHUNK_SIZE: -1,
codec: null,
init() {
Expand Down
4 changes: 2 additions & 2 deletions src/library_memfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ addToLibrary({
$MEMFS: {
ops_table: null,
mount(mount) {
return MEMFS.createNode(null, '/', {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */, 0);
return MEMFS.createNode(null, '/', {{{ cDefs.S_IFDIR | 0o777 }}}, 0);
},
createNode(parent, name, mode, dev) {
if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
Expand Down Expand Up @@ -232,7 +232,7 @@ addToLibrary({
return entries;
},
symlink(parent, newname, oldpath) {
var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | {{{ cDefs.S_IFLNK }}}, 0);
var node = MEMFS.createNode(parent, newname, 0o777 | {{{ cDefs.S_IFLNK }}}, 0);
node.link = oldpath;
return node;
},
Expand Down
2 changes: 1 addition & 1 deletion src/library_pipefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ addToLibrary({
mount(mount) {
// Do not pollute the real root directory or its child nodes with pipes
// Looks like it is OK to create another pseudo-root node not linked to the FS.root hierarchy this way
return FS.createNode(null, '/', {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */, 0);
return FS.createNode(null, '/', {{{ cDefs.S_IFDIR }}} | 0o777, 0);
},
createPipe() {
var pipe = {
Expand Down
2 changes: 1 addition & 1 deletion src/library_sockfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ addToLibrary({
SOCKFS.on('close', (fd) => dbg(`websocket: close fd = ${fd}`));
#endif

return FS.createNode(null, '/', {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */, 0);
return FS.createNode(null, '/', {{{ cDefs.S_IFDIR | 0o777 }}}, 0);
},
createSocket(family, type, protocol) {
type &= ~{{{ cDefs.SOCK_CLOEXEC | cDefs.SOCK_NONBLOCK }}}; // Some applications may pass it; it makes no sense for a single process.
Expand Down
9 changes: 4 additions & 5 deletions src/library_wasmfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ FS.init();
rmdir: (path) => FS.handleError(
withStackSave(() => __wasmfs_rmdir(stringToUTF8OnStack(path)))
),
open: (path, flags, mode) => withStackSave(() => {
open: (path, flags, mode = 0o666) => withStackSave(() => {
flags = typeof flags == 'string' ? FS_modeStringToFlags(flags) : flags;
mode = typeof mode == 'undefined' ? 438 /* 0666 */ : mode;
var buffer = stringToUTF8OnStack(path);
var fd = FS.handleError(__wasmfs_open(buffer, flags, mode));
return { fd : fd };
Expand Down Expand Up @@ -449,7 +448,7 @@ FS.init();
mkdev(path, mode, dev) {
if (typeof dev === 'undefined') {
dev = mode;
mode = 438 /* 0666 */;
mode = 0o666;
}

var deviceBackend = wasmFSDevices[dev];
Expand Down Expand Up @@ -517,7 +516,7 @@ FS.init();

$FS_create__deps: ['$FS_mknod'],
// Default settings copied from the legacy JS FS API.
$FS_create: (path, mode = 438 /* 0666 */) => {
$FS_create: (path, mode = 0o666) => {
mode &= {{{ cDefs.S_IALLUGO }}};
mode |= {{{ cDefs.S_IFREG }}};
return FS_mknod(path, mode, 0);
Expand Down Expand Up @@ -546,7 +545,7 @@ FS.init();
},

$FS_mkdir__deps: ['_wasmfs_mkdir'],
$FS_mkdir: (path, mode = 511 /* 0777 */) => FS.handleError(withStackSave(() => {
$FS_mkdir: (path, mode = 0o777) => FS.handleError(withStackSave(() => {
var buffer = stringToUTF8OnStack(path);
return __wasmfs_mkdir(buffer, mode);
})),
Expand Down
4 changes: 2 additions & 2 deletions src/library_workerfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
addToLibrary({
$WORKERFS__deps: ['$FS'],
$WORKERFS: {
DIR_MODE: {{{ cDefs.S_IFDIR }}} | 511 /* 0777 */,
FILE_MODE: {{{ cDefs.S_IFREG }}} | 511 /* 0777 */,
DIR_MODE: {{{ cDefs.S_IFDIR | 0o777 }}},
FILE_MODE: {{{ cDefs.S_IFREG | 0o777 }}},
reader: null,
mount(mount) {
assert(ENVIRONMENT_IS_WORKER);
Expand Down