Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: udev-device.cc

Issue 6838011: adds a signal, fixes a crash, adds syslogging, and marshals disks to d-bus (Closed) Base URL: ssh://gitrw.chromium.org:9222/cros-disks.git@master
Patch Set: addresses code review comments Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]);
+ }
uint64 total_size, remaining_size;
GetSizeInfo(&total_size, &remaining_size);
« no previous file with comments | « main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698