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/04/14 01:29:35 UTC

mesos git commit: Add os::stat::inode to stout.

Repository: mesos
Updated Branches:
  refs/heads/master b918c631d -> e9656abb0


Add os::stat::inode to stout.

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


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

Branch: refs/heads/master
Commit: e9656abb07684aa706c79d744be0858c9f765c33
Parents: b918c63
Author: Ian Downes <ia...@gmail.com>
Authored: Mon Apr 13 16:28:47 2015 -0700
Committer: Ian Downes <id...@twitter.com>
Committed: Mon Apr 13 16:28:47 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/e9656abb/3rdparty/libprocess/3rdparty/stout/include/stout/os/stat.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/stat.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/stat.hpp
index af940a4..270c4c8 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/stat.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/stat.hpp
@@ -98,6 +98,17 @@ inline Try<dev_t> rdev(const std::string& path)
 }
 
 
+inline Try<ino_t> inode(const std::string& path)
+{
+  struct stat s;
+
+  if (::stat(path.c_str(), &s) < 0) {
+    return ErrnoError("Error invoking stat for '" + path + "'");
+  }
+
+  return s.st_ino;
+}
+
 } // namespace stat {
 } // namespace os {
 #endif // __STOUT_OS_STAT_HPP__