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 2015/06/24 20:09:10 UTC
[5/8] mesos git commit: Removed os::dirname and os::basename.
Removed os::dirname and os::basename.
os::dirname and os::basename were not thread safe on OSX. Replacements
are Path::dirname and Path::basename.
Review: https://reviews.apache.org/r/34258
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3963610a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3963610a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3963610a
Branch: refs/heads/master
Commit: 3963610a153e23f92d05b70f504f87883049b42f
Parents: 505d383
Author: Till Toenshoff <to...@me.com>
Authored: Wed Jun 24 19:53:00 2015 +0200
Committer: Till Toenshoff <to...@me.com>
Committed: Wed Jun 24 19:53:01 2015 +0200
----------------------------------------------------------------------
3rdparty/libprocess/3rdparty/stout/README.md | 2 +-
.../3rdparty/stout/include/stout/os.hpp | 30 --------------------
2 files changed, 1 insertion(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3963610a/3rdparty/libprocess/3rdparty/stout/README.md
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/README.md b/3rdparty/libprocess/3rdparty/stout/README.md
index 795123f..0290451 100644
--- a/3rdparty/libprocess/3rdparty/stout/README.md
+++ b/3rdparty/libprocess/3rdparty/stout/README.md
@@ -236,7 +236,7 @@ A collection of utilities for working with the networking subsystem. Currently w
## `os::`
-The `os` namespace provides numerous utilities for working with the operating system. Most of these utilities are simple wrappers around C-style functions that don't cleanly take or return C++ types, for example `os::getenv`, `os::setenv`, `os::basename`, `os::dirname`, `os::realpath`, etc. The library also includes a handful of "shell familiars", such as `os::chown`, `os::touch`, `os::ls`, `os::find`, `os::su`, `os::glob`, etc. We call out a few of the special abstractions below.
+The `os` namespace provides numerous utilities for working with the operating system. Most of these utilities are simple wrappers around C-style functions that don't cleanly take or return C++ types, for example `os::getenv`, `os::setenv`, `os::realpath`, etc. The library also includes a handful of "shell familiars", such as `os::chown`, `os::touch`, `os::ls`, `os::find`, `os::su`, `os::glob`, etc. We call out a few of the special abstractions below.
#### Reading and Writing `std::string`
http://git-wip-us.apache.org/repos/asf/mesos/blob/3963610a/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 1e7aed0..0110b40 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -318,36 +318,6 @@ inline Try<Nothing> rm(const std::string& path)
}
-inline Try<std::string> basename(const std::string& path)
-{
- char* temp = new char[path.size() + 1];
- char* result = ::basename(::strcpy(temp, path.c_str()));
- if (result == NULL) {
- delete[] temp;
- return ErrnoError();
- }
-
- std::string s(result);
- delete[] temp;
- return s;
-}
-
-
-inline Try<std::string> dirname(const std::string& path)
-{
- char* temp = new char[path.size() + 1];
- char* result = ::dirname(::strcpy(temp, path.c_str()));
- if (result == NULL) {
- delete[] temp;
- return ErrnoError();
- }
-
- std::string s(result);
- delete[] temp;
- return s;
-}
-
-
inline Result<std::string> realpath(const std::string& path)
{
char temp[PATH_MAX];