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

Side by Side Diff: base/sys_info_posix.cc

Issue 12513014: POSIX: surround statvfs calls with HANDLE_EINTR (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | chrome/browser/chromeos/extensions/file_browser_private_api.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/param.h> 9 #include <sys/param.h>
10 #include <sys/utsname.h> 10 #include <sys/utsname.h>
(...skipping 26 matching lines...) Expand all
37 37
38 return static_cast<int>(res); 38 return static_cast<int>(res);
39 } 39 }
40 #endif 40 #endif
41 41
42 // static 42 // static
43 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { 43 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
44 base::ThreadRestrictions::AssertIOAllowed(); 44 base::ThreadRestrictions::AssertIOAllowed();
45 45
46 struct statvfs stats; 46 struct statvfs stats;
47 if (statvfs(path.value().c_str(), &stats) != 0) { 47 if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0)
48 return -1; 48 return -1;
49 }
50 return static_cast<int64>(stats.f_bavail) * stats.f_frsize; 49 return static_cast<int64>(stats.f_bavail) * stats.f_frsize;
51 } 50 }
52 51
53 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 52 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
54 // static 53 // static
55 std::string SysInfo::OperatingSystemName() { 54 std::string SysInfo::OperatingSystemName() {
56 struct utsname info; 55 struct utsname info;
57 if (uname(&info) < 0) { 56 if (uname(&info) < 0) {
58 NOTREACHED(); 57 NOTREACHED();
59 return ""; 58 return "";
(...skipping 29 matching lines...) Expand all
89 } 88 }
90 return arch; 89 return arch;
91 } 90 }
92 91
93 // static 92 // static
94 size_t SysInfo::VMAllocationGranularity() { 93 size_t SysInfo::VMAllocationGranularity() {
95 return getpagesize(); 94 return getpagesize();
96 } 95 }
97 96
98 } // namespace base 97 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_browser_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698