1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/storage_monitor/udev_util_linux.h"
7 #include "base/files/file_path.h"
8 #include "device/udev_linux/scoped_udev.h"
10 namespace storage_monitor
{
12 bool GetUdevDevicePropertyValueByPath(const base::FilePath
& device_path
,
14 std::string
* result
) {
15 device::ScopedUdevPtr
udev(device::udev_new());
18 device::ScopedUdevDevicePtr
device(device::udev_device_new_from_syspath(
19 udev
.get(), device_path
.value().c_str()));
22 *result
= device::UdevDeviceGetPropertyValue(device
.get(), key
);
26 } // namespace storage_monitor