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

Side by Side Diff: sandbox/linux/services/broker_process_unittest.cc

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 | « sandbox/linux/services/broker_process.cc ('k') | sandbox/linux/services/init_process_reaper.cc » ('j') | 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 "sandbox/linux/services/broker_process.h" 5 #include "sandbox/linux/services/broker_process.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 30 matching lines...) Expand all
41 static const char file_template[] = "/tmp/ScopedTempFileXXXXXX"; 41 static const char file_template[] = "/tmp/ScopedTempFileXXXXXX";
42 #endif // defined(OS_ANDROID) 42 #endif // defined(OS_ANDROID)
43 COMPILE_ASSERT(sizeof(full_file_name_) >= sizeof(file_template), 43 COMPILE_ASSERT(sizeof(full_file_name_) >= sizeof(file_template),
44 full_file_name_is_large_enough); 44 full_file_name_is_large_enough);
45 memcpy(full_file_name_, file_template, sizeof(file_template)); 45 memcpy(full_file_name_, file_template, sizeof(file_template));
46 fd_ = mkstemp(full_file_name_); 46 fd_ = mkstemp(full_file_name_);
47 CHECK_LE(0, fd_); 47 CHECK_LE(0, fd_);
48 } 48 }
49 ~ScopedTemporaryFile() { 49 ~ScopedTemporaryFile() {
50 CHECK_EQ(0, unlink(full_file_name_)); 50 CHECK_EQ(0, unlink(full_file_name_));
51 CHECK_EQ(0, HANDLE_EINTR(close(fd_))); 51 CHECK_EQ(0, IGNORE_EINTR(close(fd_)));
52 } 52 }
53 53
54 int fd() const { return fd_; } 54 int fd() const { return fd_; }
55 const char* full_file_name() const { return full_file_name_; } 55 const char* full_file_name() const { return full_file_name_; }
56 56
57 private: 57 private:
58 int fd_; 58 int fd_;
59 char full_file_name_[128]; 59 char full_file_name_[128];
60 DISALLOW_COPY_AND_ASSIGN(ScopedTemporaryFile); 60 DISALLOW_COPY_AND_ASSIGN(ScopedTemporaryFile);
61 }; 61 };
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // expected. 435 // expected.
436 } 436 }
437 437
438 TEST(BrokerProcess, OpenComplexFlagsNoClientCheck) { 438 TEST(BrokerProcess, OpenComplexFlagsNoClientCheck) {
439 TestOpenComplexFlags(false /* fast_check_in_client */); 439 TestOpenComplexFlags(false /* fast_check_in_client */);
440 // Don't do anything here, so that ASSERT works in the subfunction as 440 // Don't do anything here, so that ASSERT works in the subfunction as
441 // expected. 441 // expected.
442 } 442 }
443 443
444 } // namespace sandbox 444 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/services/broker_process.cc ('k') | sandbox/linux/services/init_process_reaper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698