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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/jsfs/js_fs.cc

Issue 565763002: Plumbing though mode parameter to open, since fusefs can make use of it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "nacl_io/jsfs/js_fs.h" 5 #include "nacl_io/jsfs/js_fs.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <limits.h> 10 #include <limits.h>
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 if (iter != responses_.end()) { 384 if (iter != responses_.end()) {
385 PP_Var response = iter->second; 385 PP_Var response = iter->second;
386 responses_.erase(iter); 386 responses_.erase(iter);
387 return response; 387 return response;
388 } 388 }
389 389
390 pthread_cond_wait(&response_cond_, lock_.mutex()); 390 pthread_cond_wait(&response_cond_, lock_.mutex());
391 } 391 }
392 } 392 }
393 393
394 Error JsFs::Open(const Path& path, int open_flags, ScopedNode* out_node) { 394 Error JsFs::OpenWithMode(const Path& path, int open_flags, mode_t t,
395 ScopedNode* out_node) {
395 out_node->reset(NULL); 396 out_node->reset(NULL);
396 ScopedVar response(ppapi_); 397 ScopedVar response(ppapi_);
397 if (!SendRequestAndWait(&response, "%s%s%d", 398 if (!SendRequestAndWait(&response, "%s%s%d",
398 "cmd", "open", 399 "cmd", "open",
399 "path", path.Join().c_str(), 400 "path", path.Join().c_str(),
400 "oflag", open_flags)) { 401 "oflag", open_flags)) {
401 LOG_ERROR("Failed to send request."); 402 LOG_ERROR("Failed to send request.");
402 return EINVAL; 403 return EINVAL;
403 } 404 }
404 405
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 LOG_TRACE("ioctl with no \"id\", ignoring.\n"); 492 LOG_TRACE("ioctl with no \"id\", ignoring.\n");
492 return EINVAL; 493 return EINVAL;
493 } 494 }
494 495
495 responses_.insert(ResponseMap_t::value_type(response_id, response)); 496 responses_.insert(ResponseMap_t::value_type(response_id, response));
496 pthread_cond_broadcast(&response_cond_); 497 pthread_cond_broadcast(&response_cond_);
497 return 0; 498 return 0;
498 } 499 }
499 500
500 } // namespace nacl_io 501 } // namespace nacl_io
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698