aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp
diff options
context:
space:
mode:
authorGravatar Thiago Farina <tfarina@chromium.org>2015-05-12 15:23:45 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-05-15 09:35:23 +0000
commit2945e0641e16fa422116a6469113f9aea15b63d7 (patch)
tree98e716e0a8038cd5fc6cc0bf74ac6d897b1ac9e2 /src/main/cpp
parent68ac06d203bd7e9abbd79a2b6dfc42b80d121311 (diff)
Cleanup: Remove unused GetMountpoint() function.
This was found by building 'client' target with -Wall. -- Change-Id: If14355813b83b9e29b36411eaf597de8d57bda6e Reviewed-on: https://bazel-review.googlesource.com/#/c/1290 MOS_MIGRATED_REVID=93415497
Diffstat (limited to 'src/main/cpp')
-rw-r--r--src/main/cpp/blaze.cc35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 39c8ecaa79..edc9f2c9f3 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -1484,41 +1484,6 @@ static void AcquireLock() {
write(globals->lockfd, msg.data(), msg.size());
}
-// Returns the mountpoint containing the specified directory, which
-// must exist. Fails if any parent path could not be statted or
-// canonicalised.
-static string GetMountpoint(string dir) {
- dev_t initial_device = -1;
- ino_t prev_inode = -1;
- string prev_dir = dir;
- for (;;) {
- struct stat buf;
- if (stat(dir.c_str(), &buf) == -1) {
- pdie(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
- "stat('%s') failed", dir.c_str());
- } else if (initial_device == -1 && prev_inode == -1) { // first time
- initial_device = buf.st_dev;
- } else if (initial_device != buf.st_dev) { // we crossed file systems
- char *resolved_path = realpath(prev_dir.c_str(), NULL);
- if (resolved_path == NULL) {
- pdie(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
- "realpath('%s') failed", prev_dir.c_str());
- }
- dir = resolved_path;
- free(resolved_path);
- return dir;
- } else if (prev_inode == buf.st_ino) { // ".." had no effect => root.
- return "/";
- }
-
- prev_inode = buf.st_ino;
- prev_dir = dir;
- dir += "/..";
- }
-
- return "/";
-}
-
static void SetupStreams() {
// Line-buffer stderr, since we always flush at the end of a server
// message. This saves lots of single-char calls to write(2).