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 2015/09/29 20:18:38 UTC

mesos git commit: Added a helper to get stat.st_dev in stout.

Repository: mesos
Updated Branches:
  refs/heads/master ebd2b0711 -> 9a9814461


Added a helper to get stat.st_dev in stout.

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


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

Branch: refs/heads/master
Commit: 9a9814461893a06faa59f6f3175abe520ee6891c
Parents: ebd2b07
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Sep 29 11:18:28 2015 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Sep 29 11:18:28 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/os/posix/stat.hpp      | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9a981446/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/stat.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/stat.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/stat.hpp
index c7084f1..6b1f7ad 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/stat.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/stat.hpp
@@ -126,6 +126,18 @@ inline Try<mode_t> mode(const std::string& path)
 }
 
 
+inline Try<dev_t> dev(const std::string& path)
+{
+  struct stat s;
+
+  if (::stat(path.c_str(), &s) < 0) {
+    return ErrnoError("Error invoking stat for '" + path + "'");
+  }
+
+  return s.st_dev;
+}
+
+
 inline Try<dev_t> rdev(const std::string& path)
 {
   struct stat s;