You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by id...@apache.org on 2015/03/11 01:24:47 UTC
[05/10] mesos git commit: Update calls to moved stout stat functions.
Update calls to moved stout stat functions.
Review: https://reviews.apache.org/r/31895
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/69a0db29
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/69a0db29
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/69a0db29
Branch: refs/heads/master
Commit: 69a0db2905e040f903046736df1e5abaea92f042
Parents: 3c13532
Author: Ian Downes <id...@twitter.com>
Authored: Tue Mar 3 14:35:52 2015 -0800
Committer: Ian Downes <id...@twitter.com>
Committed: Tue Mar 10 17:18:25 2015 -0700
----------------------------------------------------------------------
src/examples/test_hook_module.cpp | 2 +-
src/files/files.cpp | 6 +++---
src/slave/slave.cpp | 4 ++--
src/tests/hook_tests.cpp | 4 ++--
src/tests/isolator_tests.cpp | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/69a0db29/src/examples/test_hook_module.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_hook_module.cpp b/src/examples/test_hook_module.cpp
index 8faf685..2221226 100644
--- a/src/examples/test_hook_module.cpp
+++ b/src/examples/test_hook_module.cpp
@@ -107,7 +107,7 @@ public:
string path = variable.value();
// The removeExecutor hook may be called multiple times; thus
// we ignore the subsequent calls.
- if (os::isfile(path)) {
+ if (os::stat::isfile(path)) {
CHECK_SOME(os::rm(path));
}
break;
http://git-wip-us.apache.org/repos/asf/mesos/blob/69a0db29/src/files/files.cpp
----------------------------------------------------------------------
diff --git a/src/files/files.cpp b/src/files/files.cpp
index 7b10240..ce02411 100644
--- a/src/files/files.cpp
+++ b/src/files/files.cpp
@@ -246,7 +246,7 @@ Future<Response> FilesProcess::read(const Request& request)
}
// Don't read directories.
- if (os::isdir(resolvedPath.get())) {
+ if (os::stat::isdir(resolvedPath.get())) {
return BadRequest("Cannot read a directory.\n");
}
@@ -339,7 +339,7 @@ Future<Response> FilesProcess::download(const Request& request)
}
// Don't download directories.
- if (os::isdir(resolvedPath.get())) {
+ if (os::stat::isdir(resolvedPath.get())) {
return BadRequest("Cannot download a directory.\n");
}
@@ -413,7 +413,7 @@ Result<string> FilesProcess::resolve(const string& path)
// suffix, if it's not a directory and there is a suffix, return
// 'Not Found'.
string path = paths[prefix];
- if (os::isdir(path)) {
+ if (os::stat::isdir(path)) {
path = path::join(path, suffix);
// Canonicalize the absolute path.
http://git-wip-us.apache.org/repos/asf/mesos/blob/69a0db29/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 85e0bff..71ae84b 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -3781,7 +3781,7 @@ void Slave::__recover(const Future<Nothing>& future)
foreach (const string& entry, entries.get()) {
string path = path::join(directory, entry);
// Ignore non-directory entries.
- if (!os::isdir(path)) {
+ if (!os::stat::isdir(path)) {
continue;
}
@@ -3874,7 +3874,7 @@ void Slave::recoverFramework(const FrameworkState& state)
Future<Nothing> Slave::garbageCollect(const string& path)
{
- Try<long> mtime = os::mtime(path);
+ Try<long> mtime = os::stat::mtime(path);
if (mtime.isError()) {
LOG(ERROR) << "Failed to find the mtime of '" << path
<< "': " << mtime.error();
http://git-wip-us.apache.org/repos/asf/mesos/blob/69a0db29/src/tests/hook_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hook_tests.cpp b/src/tests/hook_tests.cpp
index f4b4f51..b5d776a 100644
--- a/src/tests/hook_tests.cpp
+++ b/src/tests/hook_tests.cpp
@@ -260,7 +260,7 @@ TEST_F(HookTest, DISABLED_VerifySlaveLaunchExecutorHook)
EXPECT_SOME(path);
// The file must have been create by the environment decorator hook.
- EXPECT_TRUE(os::isfile(path.get()));
+ EXPECT_TRUE(os::stat::isfile(path.get()));
driver.stop();
driver.join();
@@ -269,7 +269,7 @@ TEST_F(HookTest, DISABLED_VerifySlaveLaunchExecutorHook)
// The removeExecutor hook in the test module deletes the temp file.
// Verify that the file is not present.
- EXPECT_FALSE(os::isfile(path.get()));
+ EXPECT_FALSE(os::stat::isfile(path.get()));
}
} // namespace tests {
http://git-wip-us.apache.org/repos/asf/mesos/blob/69a0db29/src/tests/isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/isolator_tests.cpp b/src/tests/isolator_tests.cpp
index f732396..0936436 100644
--- a/src/tests/isolator_tests.cpp
+++ b/src/tests/isolator_tests.cpp
@@ -789,7 +789,7 @@ TEST_F(SharedFilesystemIsolatorTest, ROOT_RelativeVolume)
// Use /var/tmp so we don't mask the work directory (under /tmp).
const string containerPath = "/var/tmp";
- ASSERT_TRUE(os::isdir(containerPath));
+ ASSERT_TRUE(os::stat::isdir(containerPath));
// Use a host path relative to the container work directory.
const string hostPath = strings::remove(containerPath, "/", strings::PREFIX);