You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2018/06/28 18:22:21 UTC
[07/16] mesos git commit: Changed use of `os::nonblock` to
`io::prepare_async`.
Changed use of `os::nonblock` to `io::prepare_async`.
Due to the previous patch, instances that use `os::nonblock` before
sending the file descriptor to the async IO functions now need to use
`io::prepare_async`.
Review: https://reviews.apache.org/r/67387/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/379e56b8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/379e56b8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/379e56b8
Branch: refs/heads/master
Commit: 379e56b86c8cd40a04a7e7c55b3b993747f77e1c
Parents: b6f3d71
Author: Akash Gupta <ak...@hotmail.com>
Authored: Wed Jun 27 14:30:13 2018 -0700
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Jun 27 15:06:10 2018 -0700
----------------------------------------------------------------------
src/files/files.cpp | 6 +++---
src/slave/container_loggers/logrotate.cpp | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/379e56b8/src/files/files.cpp
----------------------------------------------------------------------
diff --git a/src/files/files.cpp b/src/files/files.cpp
index 8d896ed..4b8713a 100644
--- a/src/files/files.cpp
+++ b/src/files/files.cpp
@@ -711,10 +711,10 @@ Future<Try<tuple<size_t, string>, FilesError>> FilesProcess::_read(
return FilesError(FilesError::Type::UNKNOWN, error);
}
- Try<Nothing> nonblock = os::nonblock(fd.get());
- if (nonblock.isError()) {
+ Try<Nothing> async = io::prepare_async(fd.get());
+ if (async.isError()) {
string error =
- "Failed to set file descriptor nonblocking: " + nonblock.error();
+ "Failed to make file descriptor asynchronous: " + async.error();
LOG(WARNING) << error;
os::close(fd.get());
return FilesError(FilesError::Type::UNKNOWN, error);
http://git-wip-us.apache.org/repos/asf/mesos/blob/379e56b8/src/slave/container_loggers/logrotate.cpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/logrotate.cpp b/src/slave/container_loggers/logrotate.cpp
index bd41912..ff02130 100644
--- a/src/slave/container_loggers/logrotate.cpp
+++ b/src/slave/container_loggers/logrotate.cpp
@@ -99,9 +99,9 @@ public:
}
// NOTE: This is a prerequisuite for `io::read`.
- Try<Nothing> nonblock = os::nonblock(STDIN_FILENO);
- if (nonblock.isError()) {
- return Failure("Failed to set nonblocking pipe: " + nonblock.error());
+ Try<Nothing> async = io::prepare_async(STDIN_FILENO);
+ if (async.isError()) {
+ return Failure("Failed to set async pipe: " + async.error());
}
// NOTE: This does not block.