You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/10/07 16:38:52 UTC

[02/10] mesos git commit: Used unmountAll to replace the original shell script.

Used unmountAll to replace the original shell script.

Review: https://reviews.apache.org/r/52572


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f3c574d8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f3c574d8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f3c574d8

Branch: refs/heads/master
Commit: f3c574d8fae6bfc18b547528fd375fcab421041f
Parents: 131beae
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Oct 4 23:22:38 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Oct 7 09:31:17 2016 -0700

----------------------------------------------------------------------
 src/tests/environment.cpp | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f3c574d8/src/tests/environment.cpp
----------------------------------------------------------------------
diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
index fba94f6..970136f 100644
--- a/src/tests/environment.cpp
+++ b/src/tests/environment.cpp
@@ -841,15 +841,10 @@ void tests::Environment::TemporaryDirectoryEventListener::OnTestEnd(
 #ifdef __linux__
     // Try to remove any mounts under 'directory'.
     if (::geteuid() == 0) {
-      Try<string> umount = os::shell(
-          "grep '%s' /proc/mounts | "
-          "cut -d' ' -f2 | "
-          "xargs --no-run-if-empty umount -l",
-          directory.c_str());
-
-      if (umount.isError()) {
+      Try<Nothing> unmount = fs::unmountAll(directory, MNT_DETACH);
+      if (unmount.isError()) {
         LOG(ERROR) << "Failed to umount for directory '" << directory
-                   << "': " << umount.error();
+                   << "': " << unmount.error();
       }
     }
 #endif