diff --git a/system/lib/wasmfs/backends/noderawfs_root.cpp b/system/lib/wasmfs/backends/noderawfs_root.cpp index edbb667582954..52e465db092ae 100644 --- a/system/lib/wasmfs/backends/noderawfs_root.cpp +++ b/system/lib/wasmfs/backends/noderawfs_root.cpp @@ -8,7 +8,7 @@ namespace wasmfs { backend_t wasmfs_create_root_dir(void) { - return wasmfs_create_node_backend("."); + return wasmfs_create_node_backend("/"); } } // namespace wasmfs diff --git a/test/test_other.py b/test/test_other.py index 2ca45d2745a88..c61c49611cdb4 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10447,16 +10447,22 @@ def test_noderawfs_disables_embedding(self): err = self.expect_fail(base + ['--embed-file', 'somefile']) self.assertContained(expected, err) + @also_with_wasmfs def test_noderawfs_access_abspath(self): create_file('foo', 'bar') create_file('access.c', r''' + #include + #include #include + int main(int argc, char** argv) { - return access(argv[1], F_OK); + printf("testing access to %s\n", argv[1]); + int rtn = access(argv[1], F_OK); + assert(rtn == 0); + return 0; } ''') - self.run_process([EMCC, 'access.c', '-sNODERAWFS']) - self.run_js('a.out.js', args=[os.path.abspath('foo')]) + self.do_runf('access.c', cflags=['-sNODERAWFS'], args=[os.path.abspath('foo')]) def test_noderawfs_readfile_prerun(self): create_file('foo', 'bar')