| Index: device/udev_linux/udev.cc
|
| diff --git a/device/udev_linux/udev.cc b/device/udev_linux/udev.cc
|
| index 65686dade2af5c26d8bae4f34b6bee01af4412a2..e2b93d2751667eaa61e559c038674ad1d234d913 100644
|
| --- a/device/udev_linux/udev.cc
|
| +++ b/device/udev_linux/udev.cc
|
| @@ -9,6 +9,14 @@
|
|
|
| namespace device {
|
|
|
| +namespace {
|
| +
|
| +std::string StringOrEmptyIfNull(const char* value) {
|
| + return value ? value : std::string();
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| const char* udev_device_get_action(udev_device* udev_device) {
|
| return UdevLoader::Get()->udev_device_get_action(udev_device);
|
| }
|
| @@ -149,8 +157,12 @@ void udev_unref(udev* udev) {
|
|
|
| std::string UdevDeviceGetPropertyValue(udev_device* udev_device,
|
| const char* key) {
|
| - const char* value = device::udev_device_get_property_value(udev_device, key);
|
| - return value ? value : std::string();
|
| + return StringOrEmptyIfNull(udev_device_get_property_value(udev_device, key));
|
| +}
|
| +
|
| +std::string UdevDeviceGetSysattrValue(udev_device* udev_device,
|
| + const char* key) {
|
| + return StringOrEmptyIfNull(udev_device_get_sysattr_value(udev_device, key));
|
| }
|
|
|
| std::string UdevDecodeString(const std::string& encoded) {
|
|
|