summaryrefslogtreecommitdiffstats
path: root/chrome/browser/process_singleton_mac.cc
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 00:12:03 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 00:12:03 +0000
commit9e6499ead594ea1b46deb0145a4519bc52ea3678 (patch)
treec91dd35451209de210fdf197c26c2536ed8e3a6f /chrome/browser/process_singleton_mac.cc
parent439800fa6c6ae6f21fad0a82188ae318ecf4d1e9 (diff)
downloadchromium_src-9e6499ead594ea1b46deb0145a4519bc52ea3678.zip
chromium_src-9e6499ead594ea1b46deb0145a4519bc52ea3678.tar.gz
chromium_src-9e6499ead594ea1b46deb0145a4519bc52ea3678.tar.bz2
[Mac] Fix clang breakage in process_singleton_mac.cc.
Not using the return value from close() is verboten. Use the return value. Additionally, a late addition to the original CL asked for clarification that kMaxErrno wasn't "too big". Make it so. BUG=none TEST=clang builds. histograms don't take up megabytes. Review URL: http://codereview.chromium.org/3760005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton_mac.cc')
-rw-r--r--chrome/browser/process_singleton_mac.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/process_singleton_mac.cc b/chrome/browser/process_singleton_mac.cc
index 994efca..9666e4a 100644
--- a/chrome/browser/process_singleton_mac.cc
+++ b/chrome/browser/process_singleton_mac.cc
@@ -15,8 +15,10 @@
namespace {
-// From "man 2 intro".
-const int kMaxErrno = EOPNOTSUPP;
+// From "man 2 intro", the largest errno is |EOPNOTSUPP|, which is
+// |102|. Since the histogram memory usage is proportional to this
+// number, using the |102| directly rather than the macro.
+const int kMaxErrno = 102;
} // namespace
@@ -110,7 +112,9 @@ bool ProcessSingleton::Create() {
void ProcessSingleton::Cleanup() {
// Closing the file also releases the lock.
- if (lock_fd_ != -1)
- HANDLE_EINTR(close(lock_fd_));
+ if (lock_fd_ != -1) {
+ int rc = HANDLE_EINTR(close(lock_fd_));
+ DPCHECK(!rc) << "Closing lock_fd_:";
+ }
lock_fd_ = -1;
}