summaryrefslogtreecommitdiffstats
path: root/dbus/file_descriptor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/file_descriptor.cc')
-rw-r--r--dbus/file_descriptor.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/dbus/file_descriptor.cc b/dbus/file_descriptor.cc
index 91b089f..d2d6a31 100644
--- a/dbus/file_descriptor.cc
+++ b/dbus/file_descriptor.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/files/file.h"
#include "base/logging.h"
-#include "base/platform_file.h"
#include "dbus/file_descriptor.h"
namespace dbus {
FileDescriptor::~FileDescriptor() {
if (owner_)
- base::ClosePlatformFile(value_);
+ base::File auto_closer(value_);
}
int FileDescriptor::value() const {
@@ -25,8 +25,10 @@ int FileDescriptor::TakeValue() {
}
void FileDescriptor::CheckValidity() {
- base::PlatformFileInfo info;
- bool ok = base::GetPlatformFileInfo(value_, &info);
+ base::File file(value_);
+ base::File::Info info;
+ bool ok = file.GetInfo(&info);
+ file.TakePlatformFile(); // Prevent |value_| from being closed by |file|.
valid_ = (ok && !info.is_directory);
}