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/12/05 05:42:37 UTC
[5/9] mesos git commit: Added os::setctty to stout.
Added os::setctty to stout.
Review: https://reviews.apache.org/r/54292
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9248867b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9248867b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9248867b
Branch: refs/heads/master
Commit: 9248867b8401bd9c034f5759198f113d4621ee88
Parents: 5ee6f4f
Author: Jie Yu <yu...@gmail.com>
Authored: Thu Dec 1 18:15:04 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Sun Dec 4 21:41:51 2016 -0800
----------------------------------------------------------------------
3rdparty/stout/include/stout/posix/os.hpp | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9248867b/3rdparty/stout/include/stout/posix/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/posix/os.hpp b/3rdparty/stout/include/stout/posix/os.hpp
index 72e69a00..a8f7108 100644
--- a/3rdparty/stout/include/stout/posix/os.hpp
+++ b/3rdparty/stout/include/stout/posix/os.hpp
@@ -35,6 +35,8 @@
#include <unistd.h>
#include <utime.h>
+#include <sys/ioctl.h>
+
#ifdef __linux__
#include <linux/version.h>
#include <sys/sysinfo.h>
@@ -489,6 +491,15 @@ inline Try<std::string> ptsname(int master)
}
}
+
+inline Try<Nothing> setctty(int fd)
+{
+ if (ioctl(fd, TIOCSCTTY, nullptr) == -1) {
+ return ErrnoError();
+ }
+ return Nothing();
+}
+
} // namespace os {
#endif // __STOUT_POSIX_OS_HPP__