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

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

Issue 660353003: [NaCl SDK] nacl_io: Fix utime() on directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 89c8e36db7c341a23eb96d91b6443092d7851d67..0837647e566a7c19882485d665e2271d4ab07bbe 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
@@ -792,6 +792,11 @@ int KernelProxy::truncate(const char* path, off_t len) {
return -1;
}
+ // Directories cannot be truncated.
+ if (node->IsaDir()) {
+ return EISDIR;
+ }
+
if (!node->CanOpen(O_WRONLY)) {
errno = EACCES;
return -1;
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_handle.cc ('k') | native_client_sdk/src/libraries/nacl_io/memfs/mem_fs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698