Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Unified Diff: native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc

Issue 604513002: [NaCl SDK] nacl_io: Add chmod/fchmod (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 cf6cf07cf0517bc3dfd4cf09c2e29ede0b8ccf3d..b5cf443c7dbc77e49d1411adb30471a678467b65 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
@@ -799,8 +799,7 @@ int KernelProxy::remove(const char* path) {
return 0;
}
-// TODO(noelallen): Needs implementation.
-int KernelProxy::fchmod(int fd, int mode) {
+int KernelProxy::fchmod(int fd, mode_t mode) {
ScopedKernelHandle handle;
Error error = AcquireHandle(fd, &handle);
if (error) {
@@ -808,6 +807,12 @@ int KernelProxy::fchmod(int fd, int mode) {
return -1;
}
+ error = handle->node()->Fchmod(mode);
+ if (error) {
+ errno = error;
+ return -1;
+ }
+
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698