Index: content/common/sandbox_mac.mm |
diff --git a/content/common/sandbox_mac.mm b/content/common/sandbox_mac.mm |
index 94c3c3dc19dee6b629e3e16a68f2e43690d048a8..1ec37956b53ce3a3b1ddaca9bc3fcaafcf3459bf 100644 |
--- a/content/common/sandbox_mac.mm |
+++ b/content/common/sandbox_mac.mm |
@@ -17,7 +17,6 @@ |
#include "base/command_line.h" |
#include "base/compiler_specific.h" |
#include "base/file_util.h" |
-#include "base/files/scoped_file.h" |
#include "base/mac/bundle_locations.h" |
#include "base/mac/mac_util.h" |
#include "base/mac/scoped_cftyperef.h" |
@@ -608,15 +607,16 @@ |
// static |
base::FilePath Sandbox::GetCanonicalSandboxPath(const base::FilePath& path) { |
- base::ScopedFD fd(HANDLE_EINTR(open(path.value().c_str(), O_RDONLY))); |
- if (!fd.is_valid()) { |
+ int fd = HANDLE_EINTR(open(path.value().c_str(), O_RDONLY)); |
+ if (fd < 0) { |
DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
<< path.value(); |
return path; |
} |
+ file_util::ScopedFD file_closer(&fd); |
base::FilePath::CharType canonical_path[MAXPATHLEN]; |
- if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { |
+ if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { |
DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
<< path.value(); |
return path; |