From d81b8e3d775743dbc2ce49b805cbce6fcc0ea617 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 17 Dec 2018 14:29:06 -0800 Subject: roots.cpp: convert to C++ Fstab Convert code to use C++ Fstab struct and C++ std::strings. Bug: 62292478 Bug: 118634720 Test: boots Change-Id: Ibdc1df5831bc885d7c1574419f41af026e49a137 --- roots.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'roots.h') diff --git a/roots.h b/roots.h index 314eb5f26..341f90529 100644 --- a/roots.h +++ b/roots.h @@ -19,7 +19,7 @@ #include -typedef struct fstab_rec Volume; +typedef struct FstabEntry Volume; // Load and parse volume data from /etc/recovery.fstab. void load_volume_table(); @@ -29,25 +29,25 @@ Volume* volume_for_mount_point(const std::string& mount_point); // Make sure that the volume 'path' is on is mounted. Returns 0 on // success (volume is mounted). -int ensure_path_mounted(const char* path); +int ensure_path_mounted(const std::string& path); // Similar to ensure_path_mounted, but allows one to specify the mount_point. -int ensure_path_mounted_at(const char* path, const char* mount_point); +int ensure_path_mounted_at(const std::string& path, const std::string& mount_point); // Make sure that the volume 'path' is on is unmounted. Returns 0 on // success (volume is unmounted); -int ensure_path_unmounted(const char* path); +int ensure_path_unmounted(const std::string& path); // Reformat the given volume (must be the mount point only, eg // "/cache"), no paths permitted. Attempts to unmount the volume if // it is mounted. -int format_volume(const char* volume); +int format_volume(const std::string& volume); // Reformat the given volume (must be the mount point only, eg // "/cache"), no paths permitted. Attempts to unmount the volume if // it is mounted. // Copies 'directory' to root of the newly formatted volume -int format_volume(const char* volume, const char* directory); +int format_volume(const std::string& volume, const std::string& directory); // Ensure that all and only the volumes that packages expect to find // mounted (/tmp and /cache) are mounted. Returns 0 on success. -- cgit v1.2.3