Index: native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
index b554ade35226994cee50d28578dfc2fba3e156db..d3cc4d092746302689c534f1228864cbf4941992 100644 |
--- a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
@@ -77,18 +77,21 @@ Error KernelProxy::Init(PepperInterface* ppapi) { |
dev_ = 1; |
factories_["memfs"] = new TypedFsFactory<MemFs>; |
- factories_["dev"] = new TypedFsFactory<DevFs>; |
+ factories_["devfs"] = new TypedFsFactory<DevFs>; |
factories_["html5fs"] = new TypedFsFactory<Html5Fs>; |
factories_["httpfs"] = new TypedFsFactory<HttpFs>; |
factories_["passthroughfs"] = new TypedFsFactory<PassthroughFs>; |
ScopedFilesystem root_fs; |
- rtn = MountInternal("", "/", "passthroughfs", 0, NULL, false, &root_fs); |
+ rtn = MountInternal("", "/", "memfs", 0, NULL, false, &root_fs); |
+ if (rtn != 0) |
+ return rtn; |
+ rtn = this->mkdir("/dev", 0777); |
if (rtn != 0) |
return rtn; |
ScopedFilesystem fs; |
- rtn = MountInternal("", "/dev", "dev", 0, NULL, false, &fs); |
+ rtn = MountInternal("", "/dev", "devfs", 0, NULL, false, &fs); |
if (rtn != 0) |
return rtn; |
dev_fs_ = sdk_util::static_scoped_ref_cast<DevFs>(fs); |
@@ -105,21 +108,21 @@ Error KernelProxy::Init(PepperInterface* ppapi) { |
// Open the first three in order to get STDIN, STDOUT, STDERR |
int fd; |
- fd = open("/dev/stdin", O_RDONLY, 0); |
+ fd = this->open("/dev/stdin", O_RDONLY, 0); |
if (fd < 0) { |
LOG_ERROR("failed to open /dev/stdin: %s", strerror(errno)); |
return errno; |
} |
assert(fd == 0); |
- fd = open("/dev/stdout", O_WRONLY, 0); |
+ fd = this->open("/dev/stdout", O_WRONLY, 0); |
if (fd < 0) { |
LOG_ERROR("failed to open /dev/stdout: %s", strerror(errno)); |
return errno; |
} |
assert(fd == 1); |
- fd = open("/dev/stderr", O_WRONLY, 0); |
+ fd = this->open("/dev/stderr", O_WRONLY, 0); |
if (fd < 0) { |
LOG_ERROR("failed to open /dev/sterr: %s", strerror(errno)); |
return errno; |