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 6e7860960b6a9e8bea5096adc04391580984e62d..651323e01b9784b698e4601d0fc8f56a0bbf09fc 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,23 @@ Error KernelProxy::Init(PepperInterface* ppapi) { |
dev_ = 1; |
factories_["memfs"] = new TypedFsFactory<MemFs>; |
+ factories_["devfs"] = new TypedFsFactory<DevFs>; |
+ // 'devfs' used to be known as simply 'dev' |
factories_["dev"] = 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 +110,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; |