Remove unused BlockDevSize(const string& path).
Only the BlockDevSize(int fd) variant of this function is used.
Bug: None
Test: emerge-link update_engine
Change-Id: If5fea489c7563089af9cd0983d96816c3dc90cf0
diff --git a/utils.cc b/utils.cc
index ba2c837..476f307 100644
--- a/utils.cc
+++ b/utils.cc
@@ -374,21 +374,6 @@
return dev_size;
}
-off_t BlockDevSize(const string& path) {
- int fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
- if (fd == -1) {
- PLOG(ERROR) << "Error opening " << path;
- return fd;
- }
-
- off_t dev_size = BlockDevSize(fd);
- if (dev_size == -1)
- PLOG(ERROR) << "Error getting block device size on " << path;
-
- close(fd);
- return dev_size;
-}
-
off_t FileSize(int fd) {
struct stat stbuf;
int rc = fstat(fd, &stbuf);
diff --git a/utils.h b/utils.h
index 22aeba2..12197e8 100644
--- a/utils.h
+++ b/utils.h
@@ -103,9 +103,8 @@
// otherwise, in which case the state of the output container is unknown.
bool ReadPipe(const std::string& cmd, std::string* out_p);
-// Returns the size of the block device at path, or the file descriptor fd. If
-// an error occurs, -1 is returned.
-off_t BlockDevSize(const std::string& path);
+// Returns the size of the block device at the file descriptor fd. If an error
+// occurs, -1 is returned.
off_t BlockDevSize(int fd);
// Returns the size of the file at path, or the file desciptor fd. If the file