You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2015/10/28 23:11:17 UTC
[1/7] mesos git commit: Cmake: Synchronize CmakeLists.
Repository: mesos
Updated Branches:
refs/heads/master 8fe7997ac -> 0fbc6be02
Cmake: Synchronize CmakeLists.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0fbc6be0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0fbc6be0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0fbc6be0
Branch: refs/heads/master
Commit: 0fbc6be02c19be63e5c8975f3c99cb8337fc28d2
Parents: 6e04f6e
Author: Joris Van Remoortere <jo...@gmail.com>
Authored: Wed Oct 28 17:04:02 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Oct 28 17:11:03 2015 -0500
----------------------------------------------------------------------
src/CMakeLists.txt | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/0fbc6be0/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6c7519b..d107e32 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -42,7 +42,7 @@ PROTOC_TO_SRC_DIR(MESSAGES messages/messages)
PROTOC_TO_SRC_DIR(FLAGS messages/flags)
PROTOC_TO_SRC_DIR(STATE messages/state)
-PROTOC_TO_SRC_DIR(MESSAGE slave/containerizer/provisioner/docker/message)
+PROTOC_TO_SRC_DIR(MESSAGE slave/containerizer/mesos/provisioner/docker/message)
set(MESOS_PROTOBUF_SRC
${MESOS_PROTO_CC}
@@ -192,23 +192,23 @@ if (NOT WIN32)
slave/containerizer/external_containerizer.cpp
slave/containerizer/fetcher.cpp
slave/containerizer/isolator.cpp
- slave/containerizer/isolators/filesystem/posix.cpp
- slave/containerizer/isolators/posix/disk.cpp
+ slave/containerizer/mesos/isolators/filesystem/posix.cpp
+ slave/containerizer/mesos/isolators/posix/disk.cpp
slave/containerizer/launcher.cpp
slave/containerizer/mesos/containerizer.cpp
slave/containerizer/mesos/launch.cpp
- slave/containerizer/provisioner/paths.cpp
- slave/containerizer/provisioner/provisioner.cpp
- slave/containerizer/provisioner/store.cpp
- slave/containerizer/provisioner/appc/paths.cpp
- slave/containerizer/provisioner/appc/spec.cpp
- slave/containerizer/provisioner/appc/store.cpp
- slave/containerizer/provisioner/backend.cpp
- slave/containerizer/provisioner/backends/copy.cpp
- slave/containerizer/provisioner/docker/message.proto
- slave/containerizer/provisioner/docker/registry_client.cpp
- slave/containerizer/provisioner/docker/spec.cpp
- slave/containerizer/provisioner/docker/token_manager.cpp
+ slave/containerizer/mesos/provisioner/paths.cpp
+ slave/containerizer/mesos/provisioner/provisioner.cpp
+ slave/containerizer/mesos/provisioner/store.cpp
+ slave/containerizer/mesos/provisioner/appc/paths.cpp
+ slave/containerizer/mesos/provisioner/appc/spec.cpp
+ slave/containerizer/mesos/provisioner/appc/store.cpp
+ slave/containerizer/mesos/provisioner/backend.cpp
+ slave/containerizer/mesos/provisioner/backends/copy.cpp
+ slave/containerizer/mesos/provisioner/docker/message.proto
+ slave/containerizer/mesos/provisioner/docker/registry_client.cpp
+ slave/containerizer/mesos/provisioner/docker/spec.cpp
+ slave/containerizer/mesos/provisioner/docker/token_manager.cpp
slave/resource_estimators/noop.cpp
)
endif (NOT WIN32)
[7/7] mesos git commit: Windows: Moved `os::getcwd` to its own file,
`stout/os/getcwd.hpp`.
Posted by jo...@apache.org.
Windows: Moved `os::getcwd` to its own file, `stout/os/getcwd.hpp`.
Review: https://reviews.apache.org/r/39540
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c1295c41
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c1295c41
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c1295c41
Branch: refs/heads/master
Commit: c1295c418f07ef9f78952d61e4f2e932cba6ba26
Parents: e24889e
Author: Alex Clemmer <cl...@gmail.com>
Authored: Mon Oct 26 15:43:51 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Oct 28 17:11:03 2015 -0500
----------------------------------------------------------------------
.../3rdparty/stout/include/Makefile.am | 1 +
.../3rdparty/stout/include/stout/os.hpp | 1 +
.../3rdparty/stout/include/stout/os/getcwd.hpp | 52 ++++++++++++++++++++
.../3rdparty/stout/include/stout/posix/os.hpp | 24 ---------
.../3rdparty/stout/include/stout/windows.hpp | 7 +++
.../3rdparty/stout/include/stout/windows/os.hpp | 6 ---
6 files changed, 61 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c1295c41/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index 45a33b0..79c9fe4 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -59,6 +59,7 @@ nobase_include_HEADERS = \
stout/os/fcntl.hpp \
stout/os/fork.hpp \
stout/os/ftruncate.hpp \
+ stout/os/getcwd.hpp \
stout/os/killtree.hpp \
stout/os/linux.hpp \
stout/os/posix/bootid.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/c1295c41/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index 5b11ea0..ad2e1b5 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -77,6 +77,7 @@
#include <stout/os/bootid.hpp>
#include <stout/os/environment.hpp>
#include <stout/os/fork.hpp>
+#include <stout/os/getcwd.hpp>
#include <stout/os/killtree.hpp>
#include <stout/os/ls.hpp>
#include <stout/os/mktemp.hpp>
http://git-wip-us.apache.org/repos/asf/mesos/blob/c1295c41/3rdparty/libprocess/3rdparty/stout/include/stout/os/getcwd.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/getcwd.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/getcwd.hpp
new file mode 100644
index 0000000..162f046
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/getcwd.hpp
@@ -0,0 +1,52 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __STOUT_OS_GETCWD_HPP__
+#define __STOUT_OS_GETCWD_HPP__
+
+#include <stout/try.hpp>
+
+#ifdef __WINDOWS__
+#include <stout/windows.hpp> // To be certain we're using the right `getcwd`.
+#endif // __WINDOWS__
+
+
+namespace os {
+
+inline std::string getcwd()
+{
+ size_t size = 100;
+
+ while (true) {
+ char* temp = new char[size];
+ if (::getcwd(temp, size) == temp) {
+ std::string result(temp);
+ delete[] temp;
+ return result;
+ } else {
+ if (errno != ERANGE) {
+ delete[] temp;
+ return std::string();
+ }
+ size *= 2;
+ delete[] temp;
+ }
+ }
+
+ return std::string();
+}
+
+} // namespace os {
+
+
+#endif // __STOUT_OS_GETCWD_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/c1295c41/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
index 9a38733..f4bf383 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
@@ -460,30 +460,6 @@ inline Try<Nothing> su(const std::string& user)
}
-inline std::string getcwd()
-{
- size_t size = 100;
-
- while (true) {
- char* temp = new char[size];
- if (::getcwd(temp, size) == temp) {
- std::string result(temp);
- delete[] temp;
- return result;
- } else {
- if (errno != ERANGE) {
- delete[] temp;
- return std::string();
- }
- size *= 2;
- delete[] temp;
- }
- }
-
- return std::string();
-}
-
-
inline Result<std::string> user(Option<uid_t> uid = None())
{
if (uid.isNone()) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/c1295c41/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
index 4fdd34d..aa2e16e 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
@@ -203,6 +203,13 @@ decltype(_close(fd))
}
+inline auto getcwd(char* path, int maxlen) ->
+decltype(_getcwd(path, maxlen))
+{
+ return _getcwd(path, maxlen);
+}
+
+
inline auto mkdir(const char* path, mode_t mode) ->
decltype(_mkdir(path))
{
http://git-wip-us.apache.org/repos/asf/mesos/blob/c1295c41/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
index eec8f0f..ecf0e14 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
@@ -165,12 +165,6 @@ inline Try<Nothing> su(const std::string& user)
}
-inline std::string getcwd()
-{
- UNIMPLEMENTED;
-}
-
-
inline Result<std::string> user(Option<uid_t> uid = None())
{
UNIMPLEMENTED;
[4/7] mesos git commit: Windows: Moved `os::utime` to its own file,
`stout/os/utime.hpp`.
Posted by jo...@apache.org.
Windows: Moved `os::utime` to its own file, `stout/os/utime.hpp`.
Review: https://reviews.apache.org/r/39537
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/522517e5
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/522517e5
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/522517e5
Branch: refs/heads/master
Commit: 522517e551af0a14ff12ba51151533d42ce7686e
Parents: 8fe7997
Author: Alex Clemmer <cl...@gmail.com>
Authored: Mon Oct 26 13:09:42 2015 -0400
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Oct 28 17:11:03 2015 -0500
----------------------------------------------------------------------
.../3rdparty/stout/include/Makefile.am | 1 +
.../3rdparty/stout/include/stout/os.hpp | 12 +----
.../3rdparty/stout/include/stout/os/utime.hpp | 48 ++++++++++++++++++++
3 files changed, 50 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/522517e5/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index ba2836a..d2b6fe8 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -90,6 +90,7 @@ nobase_include_HEADERS = \
stout/os/permissions.hpp \
stout/os/pstree.hpp \
stout/os/sysctl.hpp \
+ stout/os/utime.hpp \
stout/os/write.hpp \
stout/os/raw/environment.hpp \
stout/os/windows/bootid.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/522517e5/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index 7f70c9e..95bdb0f 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -89,6 +89,7 @@
#include <stout/os/shell.hpp>
#include <stout/os/signals.hpp>
#include <stout/os/stat.hpp>
+#include <stout/os/utime.hpp>
#include <stout/os/write.hpp>
@@ -133,17 +134,6 @@ inline Try<bool> access(const std::string& path, int how)
}
-// Sets the access and modification times of 'path' to the current time.
-inline Try<Nothing> utime(const std::string& path)
-{
- if (::utime(path.c_str(), NULL) == -1) {
- return ErrnoError();
- }
-
- return Nothing();
-}
-
-
// Creates a temporary file using the specified path template. The
// template may be any path with _6_ `Xs' appended to it, for example
// /tmp/temp.XXXXXX. The trailing `Xs' are replaced with a unique
http://git-wip-us.apache.org/repos/asf/mesos/blob/522517e5/3rdparty/libprocess/3rdparty/stout/include/stout/os/utime.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/utime.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/utime.hpp
new file mode 100644
index 0000000..e98f673
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/utime.hpp
@@ -0,0 +1,48 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __STOUT_OS_UTIME_HPP__
+#define __STOUT_OS_UTIME_HPP__
+
+#include <string>
+
+#ifdef __WINDOWS__
+#include <sys/utime.h>
+#else
+#include <utime.h>
+#endif // __WINDOWS__
+
+#include <stout/error.hpp>
+#include <stout/nothing.hpp>
+#include <stout/try.hpp>
+
+
+namespace os {
+
+// Sets the access and modification times of 'path' to the current time.
+inline Try<Nothing> utime(const std::string& path)
+{
+ // NOTE: on Windows, this correctly dispatches to `_utime`, so there is no
+ // need to create a function alias in `stout/windows.hpp` as we have done for
+ // `stout/os/mkdir.hpp` and friends.
+ if (::utime(path.c_str(), NULL) == -1) {
+ return ErrnoError();
+ }
+
+ return Nothing();
+}
+
+} // namespace os {
+
+
+#endif // __STOUT_OS_UTIME_HPP__
[3/7] mesos git commit: Windows: Moved `os::touch` to its own file,
`stout/os/touch.hpp`.
Posted by jo...@apache.org.
Windows: Moved `os::touch` to its own file, `stout/os/touch.hpp`.
Review: https://reviews.apache.org/r/39538
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0cd54ff7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0cd54ff7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0cd54ff7
Branch: refs/heads/master
Commit: 0cd54ff76b8ea6c4fdb9103b1477c9e7fdbd795c
Parents: 522517e
Author: Alex Clemmer <cl...@gmail.com>
Authored: Mon Oct 26 12:33:31 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Oct 28 17:11:03 2015 -0500
----------------------------------------------------------------------
.../3rdparty/stout/include/Makefile.am | 1 +
.../3rdparty/stout/include/stout/os.hpp | 1 +
.../3rdparty/stout/include/stout/os/touch.hpp | 54 ++++++++++++++++++++
.../3rdparty/stout/include/stout/posix/os.hpp | 20 --------
.../3rdparty/stout/include/stout/windows/os.hpp | 6 ---
5 files changed, 56 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/0cd54ff7/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index d2b6fe8..13e4380 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -90,6 +90,7 @@ nobase_include_HEADERS = \
stout/os/permissions.hpp \
stout/os/pstree.hpp \
stout/os/sysctl.hpp \
+ stout/os/touch.hpp \
stout/os/utime.hpp \
stout/os/write.hpp \
stout/os/raw/environment.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/0cd54ff7/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index 95bdb0f..a702e6b 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -89,6 +89,7 @@
#include <stout/os/shell.hpp>
#include <stout/os/signals.hpp>
#include <stout/os/stat.hpp>
+#include <stout/os/touch.hpp>
#include <stout/os/utime.hpp>
#include <stout/os/write.hpp>
http://git-wip-us.apache.org/repos/asf/mesos/blob/0cd54ff7/3rdparty/libprocess/3rdparty/stout/include/stout/os/touch.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/touch.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/touch.hpp
new file mode 100644
index 0000000..25f51a5
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/touch.hpp
@@ -0,0 +1,54 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __STOUT_OS_TOUCH_HPP__
+#define __STOUT_OS_TOUCH_HPP__
+
+#include <stout/nothing.hpp>
+#include <stout/try.hpp>
+
+#include <stout/os/close.hpp>
+#include <stout/os/exists.hpp>
+#include <stout/os/open.hpp>
+#include <stout/os/utime.hpp>
+
+#ifdef __WINDOWS__
+#include <stout/windows.hpp>
+#endif // __WINDOWS__
+
+
+namespace os {
+
+inline Try<Nothing> touch(const std::string& path)
+{
+ if (!os::exists(path)) {
+ Try<int> fd = os::open(
+ path,
+ O_RDWR | O_CREAT,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+ if (fd.isError()) {
+ return Error("Failed to open file: " + fd.error());
+ }
+
+ return os::close(fd.get());
+ }
+
+ // Update the access and modification times.
+ return os::utime(path);
+}
+
+} // namespace os {
+
+
+#endif // __STOUT_OS_TOUCH_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/0cd54ff7/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
index b6afe0e..9a38733 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
@@ -107,26 +107,6 @@ inline void unsetenv(const std::string& key)
}
-inline Try<Nothing> touch(const std::string& path)
-{
- if (!exists(path)) {
- Try<int> fd = open(
- path,
- O_RDWR | O_CREAT,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-
- if (fd.isError()) {
- return Error("Failed to open file: " + fd.error());
- }
-
- return close(fd.get());
- }
-
- // Update the access and modification times.
- return utime(path);
-}
-
-
// Creates a temporary directory using the specified path
// template. The template may be any path with _6_ `Xs' appended to
// it, for example /tmp/temp.XXXXXX. The trailing `Xs' are replaced
http://git-wip-us.apache.org/repos/asf/mesos/blob/0cd54ff7/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
index 3e6f2aa..eec8f0f 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
@@ -56,12 +56,6 @@ inline void unsetenv(const std::string& key)
}
-inline Try<Nothing> touch(const std::string& path)
-{
- UNIMPLEMENTED;
-}
-
-
// Creates a temporary directory using the specified path
// template. The template may be any path with _6_ `Xs' appended to
// it, for example /tmp/temp.XXXXXX. The trailing `Xs' are replaced
[5/7] mesos git commit: Windows: Moved `os::mktemp` to its own file,
`stout/os/mktemp.hpp`.
Posted by jo...@apache.org.
Windows: Moved `os::mktemp` to its own file, `stout/os/mktemp.hpp`.
Review: https://reviews.apache.org/r/39539
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e24889e5
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e24889e5
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e24889e5
Branch: refs/heads/master
Commit: e24889e5288948b47d21f82f43f62d1899b176f6
Parents: 0cd54ff
Author: Alex Clemmer <cl...@gmail.com>
Authored: Mon Oct 26 12:37:51 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Oct 28 17:11:03 2015 -0500
----------------------------------------------------------------------
.../3rdparty/stout/include/Makefile.am | 1 +
.../3rdparty/stout/include/stout/os.hpp | 26 +---
.../3rdparty/stout/include/stout/os/mktemp.hpp | 58 ++++++++
.../3rdparty/stout/include/stout/windows.hpp | 131 +++++++++++--------
4 files changed, 134 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/e24889e5/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index 13e4380..45a33b0 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -75,6 +75,7 @@ nobase_include_HEADERS = \
stout/os/posix/signals.hpp \
stout/os/posix/stat.hpp \
stout/os/ls.hpp \
+ stout/os/mktemp.hpp \
stout/os/open.hpp \
stout/os/os.hpp \
stout/os/osx.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/e24889e5/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index a702e6b..5b11ea0 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -79,6 +79,7 @@
#include <stout/os/fork.hpp>
#include <stout/os/killtree.hpp>
#include <stout/os/ls.hpp>
+#include <stout/os/mktemp.hpp>
#include <stout/os/permissions.hpp>
#include <stout/os/os.hpp>
#include <stout/os/read.hpp>
@@ -135,31 +136,6 @@ inline Try<bool> access(const std::string& path, int how)
}
-// Creates a temporary file using the specified path template. The
-// template may be any path with _6_ `Xs' appended to it, for example
-// /tmp/temp.XXXXXX. The trailing `Xs' are replaced with a unique
-// alphanumeric combination.
-inline Try<std::string> mktemp(const std::string& path = "/tmp/XXXXXX")
-{
- char* temp = new char[path.size() + 1];
- int fd = ::mkstemp(::strcpy(temp, path.c_str()));
-
- if (fd < 0) {
- delete[] temp;
- return ErrnoError();
- }
-
- // We ignore the return value of close(). This is because users
- // calling this function are interested in the return value of
- // mkstemp(). Also an unsuccessful close() doesn't affect the file.
- os::close(fd);
-
- std::string result(temp);
- delete[] temp;
- return result;
-}
-
-
inline Try<Nothing> mkdir(const std::string& directory, bool recursive = true)
{
if (!recursive) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/e24889e5/3rdparty/libprocess/3rdparty/stout/include/stout/os/mktemp.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/mktemp.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/mktemp.hpp
new file mode 100644
index 0000000..fa109ba
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/mktemp.hpp
@@ -0,0 +1,58 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __STOUT_OS_MKTEMP_HPP__
+#define __STOUT_OS_MKTEMP_HPP__
+
+#include <string>
+
+#include <stout/error.hpp>
+#include <stout/try.hpp>
+
+#ifdef __WINDOWS__
+#include <stout/windows.hpp> // To be certain we're using the right `mkstemp`.
+#endif // __WINDOWS__
+
+#include <stout/os/close.hpp>
+
+
+namespace os {
+
+// Creates a temporary file using the specified path template. The
+// template may be any path with _6_ `Xs' appended to it, for example
+// /tmp/temp.XXXXXX. The trailing `Xs' are replaced with a unique
+// alphanumeric combination.
+inline Try<std::string> mktemp(const std::string& path = "/tmp/XXXXXX")
+{
+ char* temp = new char[path.size() + 1];
+ int fd = ::mkstemp(::strcpy(temp, path.c_str()));
+
+ if (fd < 0) {
+ delete[] temp;
+ return ErrnoError();
+ }
+
+ // We ignore the return value of close(). This is because users
+ // calling this function are interested in the return value of
+ // mkstemp(). Also an unsuccessful close() doesn't affect the file.
+ os::close(fd);
+
+ std::string result(temp);
+ delete[] temp;
+ return result;
+}
+
+} // namespace os {
+
+
+#endif // __STOUT_OS_MKTEMP_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/e24889e5/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
index 7a88195..4fdd34d 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
@@ -82,63 +82,6 @@ typedef SSIZE_T ssize_t;
// have to change any socket code.
constexpr int SHUT_RD = SD_RECEIVE;
-// File I/O function aliases.
-//
-// NOTE: The use of `auto` and the trailing return type in the following
-// functions are meant to make it easier for Linux developers to use and
-// maintain the code. It is an explicit marker that we are using the compiler
-// to guarantee that the return type is identical to whatever is in the Windows
-// implementation of the standard.
-inline auto write(int fd, const void* buffer, size_t count) ->
-decltype(_write(fd, buffer, count))
-{
- return _write(fd, buffer, count);
-}
-
-
-inline auto open(const char* path, int flags) ->
-decltype(_open(path, flags))
-{
- return _open(path, flags);
-}
-
-
-inline auto close(int fd) ->
-decltype(_close(fd))
-{
- return _close(fd);
-}
-
-
-// Filesystem function aliases.
-inline auto mkdir(const char* path, mode_t mode) ->
-decltype(_mkdir(path))
-{
- return _mkdir(path);
-}
-
-
-inline auto mkstemp(char* path) ->
-decltype(_mktemp_s(path, strlen(path) + 1))
-{
- return _mktemp_s(path, strlen(path) + 1);
-}
-
-
-
-inline auto realpath(const char* path, char* resolved) ->
-decltype(_fullpath(resolved, path, PATH_MAX))
-{
- return _fullpath(resolved, path, PATH_MAX);
-}
-
-
-inline auto access(const char* fileName, int accessMode) ->
-decltype(_access(fileName, accessMode))
-{
- return _access(fileName, accessMode);
-}
-
// Permissions API. (cf. MESOS-3176 to track ongoing permissions work.)
//
@@ -232,4 +175,78 @@ const mode_t S_ISGID = 0x04000000; // No-op.
const mode_t S_ISVTX = 0x02000000; // No-op.
+// File I/O function aliases.
+//
+// NOTE: The use of `auto` and the trailing return type in the following
+// functions are meant to make it easier for Linux developers to use and
+// maintain the code. It is an explicit marker that we are using the compiler
+// to guarantee that the return type is identical to whatever is in the Windows
+// implementation of the standard.
+inline auto write(int fd, const void* buffer, size_t count) ->
+decltype(_write(fd, buffer, count))
+{
+ return _write(fd, buffer, count);
+}
+
+
+inline auto open(const char* path, int flags) ->
+decltype(_open(path, flags))
+{
+ return _open(path, flags);
+}
+
+
+inline auto close(int fd) ->
+decltype(_close(fd))
+{
+ return _close(fd);
+}
+
+
+inline auto mkdir(const char* path, mode_t mode) ->
+decltype(_mkdir(path))
+{
+ return _mkdir(path);
+}
+
+
+inline auto mktemp(char* path) ->
+decltype(_mktemp(path))
+{
+ return _mktemp(path);
+}
+
+
+inline auto mkstemp(char* path) ->
+decltype(_mktemp_s(path, strlen(path) + 1))
+{
+ // NOTE: in the POSIX spec, `mkstemp` will generate a random filename from
+ // the `path` template, `open` that filename, and return the resulting file
+ // descriptor. On Windows, `_mktemp_s` will actually only generate the path,
+ // so here we actually have to call `open` ourselves to get a file descriptor
+ // we can return as a result.
+ if (_mktemp_s(path, strlen(path) + 1) != 0) {
+ return -1;
+ }
+
+ // NOTE: We open the file with read / write access for the given user, an
+ // attempt to match POSIX's specification of `mkstemp`.
+ return _open(path, S_IRUSR | S_IWUSR);
+}
+
+
+inline auto realpath(const char* path, char* resolved) ->
+decltype(_fullpath(resolved, path, PATH_MAX))
+{
+ return _fullpath(resolved, path, PATH_MAX);
+}
+
+
+inline auto access(const char* fileName, int accessMode) ->
+decltype(_access(fileName, accessMode))
+{
+ return _access(fileName, accessMode);
+}
+
+
#endif // __STOUT_WINDOWS_HPP__
[6/7] mesos git commit: Windows: Moved `os::mkdir` to its own file,
`stout/os/mkdir`.
Posted by jo...@apache.org.
Windows: Moved `os::mkdir` to its own file, `stout/os/mkdir`.
review: https://reviews.apache.org/r/39383
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6e04f6e6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6e04f6e6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6e04f6e6
Branch: refs/heads/master
Commit: 6e04f6e681413eeaca99b17db3db481a45df13cd
Parents: ffb5105
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Oct 28 16:01:14 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Oct 28 17:11:03 2015 -0500
----------------------------------------------------------------------
.../3rdparty/stout/include/Makefile.am | 6 +-
.../3rdparty/stout/include/stout/os.hpp | 31 +--------
.../stout/include/stout/os/constants.hpp | 25 +++++++
.../3rdparty/stout/include/stout/os/mkdir.hpp | 70 ++++++++++++++++++++
4 files changed, 101 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/6e04f6e6/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index 16db9a6..67b142b 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -55,6 +55,7 @@ nobase_include_HEADERS = \
stout/os/bootid.hpp \
stout/os/chdir.hpp \
stout/os/close.hpp \
+ stout/os/constants.hpp \
stout/os/environment.hpp \
stout/os/exists.hpp \
stout/os/fcntl.hpp \
@@ -77,11 +78,14 @@ nobase_include_HEADERS = \
stout/os/posix/signals.hpp \
stout/os/posix/stat.hpp \
stout/os/ls.hpp \
+ stout/os/mkdir.hpp \
stout/os/mktemp.hpp \
stout/os/open.hpp \
stout/os/os.hpp \
stout/os/osx.hpp \
+ stout/os/permissions.hpp \
stout/os/process.hpp \
+ stout/os/pstree.hpp \
stout/os/read.hpp \
stout/os/realpath.hpp \
stout/os/rename.hpp \
@@ -90,8 +94,6 @@ nobase_include_HEADERS = \
stout/os/shell.hpp \
stout/os/signals.hpp \
stout/os/stat.hpp \
- stout/os/permissions.hpp \
- stout/os/pstree.hpp \
stout/os/sysctl.hpp \
stout/os/touch.hpp \
stout/os/utime.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/6e04f6e6/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index 05b5845..fc2df68 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -81,9 +81,10 @@
#include <stout/os/getcwd.hpp>
#include <stout/os/killtree.hpp>
#include <stout/os/ls.hpp>
+#include <stout/os/mkdir.hpp>
#include <stout/os/mktemp.hpp>
-#include <stout/os/permissions.hpp>
#include <stout/os/os.hpp>
+#include <stout/os/permissions.hpp>
#include <stout/os/read.hpp>
#include <stout/os/realpath.hpp>
#include <stout/os/rename.hpp>
@@ -138,34 +139,6 @@ inline Try<bool> access(const std::string& path, int how)
}
-inline Try<Nothing> mkdir(const std::string& directory, bool recursive = true)
-{
- if (!recursive) {
- if (::mkdir(directory.c_str(), 0755) < 0) {
- return ErrnoError();
- }
- } else {
- std::vector<std::string> tokens = strings::tokenize(directory, "/");
- std::string path = "";
-
- // We got an absolute path, so keep the leading slash.
- if (directory.find_first_of("/") == 0) {
- path = "/";
- }
-
- foreach (const std::string& token, tokens) {
- path += token;
- if (::mkdir(path.c_str(), 0755) < 0 && errno != EEXIST) {
- return ErrnoError();
- }
- path += "/";
- }
- }
-
- return Nothing();
-}
-
-
// Return the list of file paths that match the given pattern by recursively
// searching the given directory. A match is successful if the pattern is a
// substring of the file name.
http://git-wip-us.apache.org/repos/asf/mesos/blob/6e04f6e6/3rdparty/libprocess/3rdparty/stout/include/stout/os/constants.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/constants.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/constants.hpp
new file mode 100644
index 0000000..bd8bfb7
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/constants.hpp
@@ -0,0 +1,25 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __STOUT_OS_CONSTANTS_HPP__
+#define __STOUT_OS_CONSTANTS_HPP__
+
+#include <string>
+
+namespace os {
+
+const std::string DIRECTORY_SEPARATOR = "/";
+
+} // namespace os {
+
+#endif // __STOUT_OS_CONSTANTS_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/6e04f6e6/3rdparty/libprocess/3rdparty/stout/include/stout/os/mkdir.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/mkdir.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/mkdir.hpp
new file mode 100644
index 0000000..8c9c0a1
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/mkdir.hpp
@@ -0,0 +1,70 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __STOUT_OS_MKDIR_HPP__
+#define __STOUT_OS_MKDIR_HPP__
+
+#ifndef __WINDOWS__
+#include <sys/stat.h>
+#endif // __WINDOWS__
+
+#include <string>
+#include <vector>
+
+#include <stout/error.hpp>
+#include <stout/nothing.hpp>
+#include <stout/strings.hpp>
+#include <stout/try.hpp>
+
+#include <stout/os/constants.hpp>
+
+#ifdef __WINDOWS__
+#include <stout/windows.hpp> // To be certain we're using the right `mkdir`.
+#endif // __WINDOWS__
+
+
+namespace os {
+
+inline Try<Nothing> mkdir(const std::string& directory, bool recursive = true)
+{
+ if (!recursive) {
+ if (::mkdir(directory.c_str(), 0755) < 0) {
+ return ErrnoError();
+ }
+ } else {
+ std::vector<std::string> tokens =
+ strings::tokenize(directory, os::DIRECTORY_SEPARATOR);
+
+ std::string path = "";
+
+ // We got an absolute path, so keep the leading slash.
+ if (directory.find_first_of(os::DIRECTORY_SEPARATOR) == 0) {
+ path = os::DIRECTORY_SEPARATOR;
+ }
+
+ foreach (const std::string& token, tokens) {
+ path += token;
+ if (::mkdir(path.c_str(), 0755) < 0 && errno != EEXIST) {
+ return ErrnoError();
+ }
+
+ path += os::DIRECTORY_SEPARATOR;
+ }
+ }
+
+ return Nothing();
+}
+
+} // namespace os {
+
+#endif // __STOUT_OS_MKDIR_HPP__
[2/7] mesos git commit: Windows: Moved `os::chdir` to its own file,
`stout/os/chdir.hpp`.
Posted by jo...@apache.org.
Windows: Moved `os::chdir` to its own file, `stout/os/chdir.hpp`.
Review: https://reviews.apache.org/r/39541
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ffb5105e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ffb5105e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ffb5105e
Branch: refs/heads/master
Commit: ffb5105e26748c4d04c19e6dc1b247157608e006
Parents: c1295c4
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Oct 28 15:54:18 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Oct 28 17:11:03 2015 -0500
----------------------------------------------------------------------
.../3rdparty/stout/include/Makefile.am | 1 +
.../3rdparty/stout/include/stout/os.hpp | 1 +
.../3rdparty/stout/include/stout/os/chdir.hpp | 42 ++++++++++++++++++++
.../3rdparty/stout/include/stout/posix/os.hpp | 10 -----
.../3rdparty/stout/include/stout/windows.hpp | 7 ++++
.../3rdparty/stout/include/stout/windows/os.hpp | 6 ---
6 files changed, 51 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ffb5105e/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
index 79c9fe4..16db9a6 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/include/Makefile.am
@@ -53,6 +53,7 @@ nobase_include_HEADERS = \
stout/option.hpp \
stout/os.hpp \
stout/os/bootid.hpp \
+ stout/os/chdir.hpp \
stout/os/close.hpp \
stout/os/environment.hpp \
stout/os/exists.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/ffb5105e/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index ad2e1b5..05b5845 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -75,6 +75,7 @@
#include <stout/version.hpp>
#include <stout/os/bootid.hpp>
+#include <stout/os/chdir.hpp>
#include <stout/os/environment.hpp>
#include <stout/os/fork.hpp>
#include <stout/os/getcwd.hpp>
http://git-wip-us.apache.org/repos/asf/mesos/blob/ffb5105e/3rdparty/libprocess/3rdparty/stout/include/stout/os/chdir.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/chdir.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/chdir.hpp
new file mode 100644
index 0000000..a76c271
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/chdir.hpp
@@ -0,0 +1,42 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __STOUT_OS_CHDIR_HPP__
+#define __STOUT_OS_CHDIR_HPP__
+
+#include <string>
+
+#include <stout/error.hpp>
+#include <stout/nothing.hpp>
+#include <stout/try.hpp>
+
+#ifdef __WINDOWS__
+#include <stout/windows.hpp> // To be certain we're using the right `chdir`.
+#endif // __WINDOWS__
+
+
+namespace os {
+
+inline Try<Nothing> chdir(const std::string& directory)
+{
+ if (::chdir(directory.c_str()) < 0) {
+ return ErrnoError();
+ }
+
+ return Nothing();
+}
+
+} // namespace os {
+
+
+#endif // __STOUT_OS_CHDIR_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/ffb5105e/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
index f4bf383..e26df59 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
@@ -286,16 +286,6 @@ inline Try<Nothing> chmod(const std::string& path, int mode)
}
-inline Try<Nothing> chdir(const std::string& directory)
-{
- if (::chdir(directory.c_str()) < 0) {
- return ErrnoError();
- }
-
- return Nothing();
-}
-
-
inline Try<Nothing> chroot(const std::string& directory)
{
if (::chroot(directory.c_str()) < 0) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/ffb5105e/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
index aa2e16e..1a7037d 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
@@ -203,6 +203,13 @@ decltype(_close(fd))
}
+inline auto chdir(const char* path) ->
+decltype(_chdir(path))
+{
+ return _chdir(path);
+}
+
+
inline auto getcwd(char* path, int maxlen) ->
decltype(_getcwd(path, maxlen))
{
http://git-wip-us.apache.org/repos/asf/mesos/blob/ffb5105e/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
index ecf0e14..edf17d5 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp
@@ -126,12 +126,6 @@ inline Try<Nothing> chmod(const std::string& path, int mode)
}
-inline Try<Nothing> chdir(const std::string& directory)
-{
- UNIMPLEMENTED;
-}
-
-
inline Try<Nothing> chroot(const std::string& directory)
{
UNIMPLEMENTED;