Repository: mesos Updated Branches: refs/heads/master 84d89ae86 -> acde41af9
Fixed compilation error caused by prctl and recent subprocess change. - Added missing `#include sys/prctl.h`. - Replaced `close` with `::close`. - Fixed sign-mismatch comparison. Review: https://reviews.apache.org/r/47287 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/acde41af Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/acde41af Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/acde41af Branch: refs/heads/master Commit: acde41af997acdd4b3f9f446f3cc95a9f055e63a Parents: 84d89ae Author: Kapil Arya <[email protected]> Authored: Thu May 12 01:08:07 2016 -0400 Committer: Kapil Arya <[email protected]> Committed: Thu May 12 01:10:10 2016 -0400 ---------------------------------------------------------------------- 3rdparty/libprocess/include/process/posix/subprocess.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/acde41af/3rdparty/libprocess/include/process/posix/subprocess.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/include/process/posix/subprocess.hpp b/3rdparty/libprocess/include/process/posix/subprocess.hpp index 7079492..36bbe28 100644 --- a/3rdparty/libprocess/include/process/posix/subprocess.hpp +++ b/3rdparty/libprocess/include/process/posix/subprocess.hpp @@ -13,6 +13,9 @@ #ifndef __PROCESS_POSIX_SUBPROCESS_HPP__ #define __PROCESS_POSIX_SUBPROCESS_HPP__ +#ifdef __linux__ +#include <sys/prctl.h> +#endif // __linux__ #include <sys/types.h> #include <string> @@ -171,9 +174,9 @@ inline int watchdogProcess() // Close the files to prevent interference on the communication // between the slave and the child process. - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); + ::close(STDIN_FILENO); + ::close(STDOUT_FILENO); + ::close(STDERR_FILENO); // Block until the child process finishes. int status = 0; @@ -321,7 +324,7 @@ inline Try<pid_t> cloneChild( // to construct them here before doing the clone as it might not be // async signal safe to perform the memory allocation. char** _argv = new char*[argv.size() + 1]; - for (int i = 0; i < argv.size(); i++) { + for (size_t i = 0; i < argv.size(); i++) { _argv[i] = (char*) argv[i].c_str(); } _argv[argv.size()] = NULL;
