Chromium Code Reviews| Index: udev-device.cc |
| diff --git a/udev-device.cc b/udev-device.cc |
| index e324706b445a193bf59e191b8c322fdf25294bbf..bd62b34cbf6a22d3549ad8c1170cb5f63542952f 100644 |
| --- a/udev-device.cc |
| +++ b/udev-device.cc |
| @@ -109,6 +109,7 @@ std::vector<std::string> UdevDevice::GetMountedPaths() const { |
| if (fs.is_open()) { |
| return ParseMountedPaths(dev_file, fs); |
| } |
| + LOG(INFO) << "unable to parse /proc/mounts"; |
| return std::vector<std::string>(); |
| } |
| @@ -145,7 +146,11 @@ Disk UdevDevice::ToDisk() const { |
| std::vector<std::string> mounted_paths = GetMountedPaths(); |
| disk.set_is_mounted(!mounted_paths.empty()); |
| - disk.set_mount_path(mounted_paths[0]); // TODO(benchan): multiple paths |
| + |
| + if (!mounted_paths.empty()) { |
| + // TODO(benchan): support multiple paths |
| + disk.set_mount_path(mounted_paths[0]); |
| + } |
|
Ben Chan
2011/04/13 15:11:47
My bad. If Disk accepts a delimited list of mount
|
| uint64 total_size, remaining_size; |
| GetSizeInfo(&total_size, &remaining_size); |