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

Side by Side Diff: rlz/mac/lib/rlz_value_store_mac.mm

Issue 10827449: mac/rlz: Correctly check for fd existence (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "rlz/mac/lib/rlz_value_store_mac.h" 5 #include "rlz/mac/lib/rlz_value_store_mac.h"
6 6
7 #include "base/eintr_wrapper.h" 7 #include "base/eintr_wrapper.h"
8 #include "base/mac/foundation_util.h" 8 #include "base/mac/foundation_util.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 file_lock_ = -1; 289 file_lock_ = -1;
290 return false; 290 return false;
291 } 291 }
292 return true; 292 return true;
293 } else { 293 } else {
294 return file_lock_ != -1; 294 return file_lock_ != -1;
295 } 295 }
296 } 296 }
297 297
298 void RecursiveCrossProcessLock::ReleaseLock() { 298 void RecursiveCrossProcessLock::ReleaseLock() {
299 if (file_lock_) { 299 if (file_lock_ != -1) {
300 ignore_result(HANDLE_EINTR(flock(file_lock_, LOCK_UN))); 300 ignore_result(HANDLE_EINTR(flock(file_lock_, LOCK_UN)));
301 ignore_result(HANDLE_EINTR(close(file_lock_))); 301 ignore_result(HANDLE_EINTR(close(file_lock_)));
302 file_lock_ = -1; 302 file_lock_ = -1;
303 } 303 }
304 304
305 locking_thread_ = 0; 305 locking_thread_ = 0;
306 pthread_mutex_unlock(&recursive_lock_); 306 pthread_mutex_unlock(&recursive_lock_);
307 } 307 }
308 308
309 309
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } else { 445 } else {
446 // Not Unsafe on OS X. 446 // Not Unsafe on OS X.
447 g_test_folder = 447 g_test_folder =
448 [[NSString alloc] initWithUTF8String:directory.AsUTF8Unsafe().c_str()]; 448 [[NSString alloc] initWithUTF8String:directory.AsUTF8Unsafe().c_str()];
449 } 449 }
450 } 450 }
451 451
452 } // namespace testing 452 } // namespace testing
453 453
454 } // namespace rlz_lib 454 } // namespace rlz_lib
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698