You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2018/11/24 00:33:58 UTC

[mesos] branch master updated: Added guards around convertStringToInt to prevent warning.

This is an automated email from the ASF dual-hosted git repository.

tillt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new d278cb1  Added guards around convertStringToInt to prevent warning.
d278cb1 is described below

commit d278cb1393fc3f864a7c9caf5fb4994b5525f826
Author: Till Toenshoff <to...@me.com>
AuthorDate: Sat Nov 24 01:33:49 2018 +0100

    Added guards around convertStringToInt to prevent warning.
    
    Review: https://reviews.apache.org/r/69439/
---
 3rdparty/libprocess/src/posix/subprocess.hpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/3rdparty/libprocess/src/posix/subprocess.hpp b/3rdparty/libprocess/src/posix/subprocess.hpp
index 719bdf3..7bbf91e 100644
--- a/3rdparty/libprocess/src/posix/subprocess.hpp
+++ b/3rdparty/libprocess/src/posix/subprocess.hpp
@@ -56,6 +56,7 @@ static void close(
     const Subprocess::IO::OutputFileDescriptors& stderrfds);
 
 
+#if defined(__linux__) && defined(SYS_getdents64)
 // Convert a null-terminated string to an integer. This function
 // is async signal safe since it does not make any libc calls.
 static int convertStringToInt(const char *name)
@@ -73,6 +74,7 @@ static int convertStringToInt(const char *name)
 
   return num;
 }
+#endif // __linux__ && SYS_getdents64
 
 
 // Close any file descriptors that are not stdio file descriptors and not
@@ -137,7 +139,7 @@ static void handleWhitelistFds(const std::vector<int_fd>& whitelist_fds)
   }
 
   ::close(fdDir);
-#endif
+#endif // __linux__ && SYS_getdents64
 
   foreach (int_fd fd, whitelist_fds) {
     int flags = ::fcntl(fd, F_GETFD);