You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jp...@apache.org on 2018/06/27 06:43:55 UTC

mesos git commit: Removed ifdef from library path construction.

Repository: mesos
Updated Branches:
  refs/heads/master b581136bd -> 71fa22ab6


Removed ifdef from library path construction.

We don't need to use ifdefs to construct the platform-specific
Mesos library name, we can use the stout `os::libraries` API
instead.

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


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

Branch: refs/heads/master
Commit: 71fa22ab68dab18872bc598aa99bf937b2591e20
Parents: b581136
Author: James Peach <jp...@apache.org>
Authored: Wed Jun 27 16:43:21 2018 +1000
Committer: James Peach <jp...@apache.org>
Committed: Wed Jun 27 16:43:21 2018 +1000

----------------------------------------------------------------------
 src/slave/slave.cpp | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/71fa22ab/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 8edd652..06c2f5f 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -9975,12 +9975,8 @@ map<string, string> executorEnvironment(
   // TODO(tillt): Adapt library towards JNI specific name once libmesos
   // has been split.
   if (environment.count("MESOS_NATIVE_JAVA_LIBRARY") == 0) {
-    string path =
-#ifdef __APPLE__
-      LIBDIR "/libmesos-" VERSION ".dylib";
-#else
-      LIBDIR "/libmesos-" VERSION ".so";
-#endif
+    const string path =
+      path::join(LIBDIR, os::libraries::expandName("mesos-" VERSION));
     if (os::exists(path)) {
       environment["MESOS_NATIVE_JAVA_LIBRARY"] = path;
     }
@@ -9990,12 +9986,8 @@ map<string, string> executorEnvironment(
   // This environment variable is kept for offering non JVM-based
   // frameworks a more compact and JNI independent library.
   if (environment.count("MESOS_NATIVE_LIBRARY") == 0) {
-    string path =
-#ifdef __APPLE__
-      LIBDIR "/libmesos-" VERSION ".dylib";
-#else
-      LIBDIR "/libmesos-" VERSION ".so";
-#endif
+    const string path =
+      path::join(LIBDIR, os::libraries::expandName("mesos-" VERSION));
     if (os::exists(path)) {
       environment["MESOS_NATIVE_LIBRARY"] = path;
     }