You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/12/03 13:49:26 UTC

mesos git commit: Made parameter type of process::io::write() a const pointer.

Repository: mesos
Updated Branches:
  refs/heads/master 457e536e9 -> 616168229


Made parameter type of process::io::write() a const pointer.

This corrects the implementation and avoids C-style casts.

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


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

Branch: refs/heads/master
Commit: 616168229c04c5c2dd08dd5ebff7b089bf2f69c9
Parents: 457e536
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu Dec 3 13:46:41 2015 +0100
Committer: Bernd Mathiske <be...@mesosphere.io>
Committed: Thu Dec 3 13:46:42 2015 +0100

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/io.hpp | 2 +-
 3rdparty/libprocess/src/io.cpp             | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/61616822/3rdparty/libprocess/include/process/io.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/io.hpp b/3rdparty/libprocess/include/process/io.hpp
index 9a24c67..52b7ee5 100644
--- a/3rdparty/libprocess/include/process/io.hpp
+++ b/3rdparty/libprocess/include/process/io.hpp
@@ -92,7 +92,7 @@ Future<std::string> read(int fd);
  *     If writing to a socket or pipe, an error will be returned if the
  *     the read end of the socket or pipe has been closed.
  */
-Future<size_t> write(int fd, void* data, size_t size);
+Future<size_t> write(int fd, const void* data, size_t size);
 
 
 /**

http://git-wip-us.apache.org/repos/asf/mesos/blob/61616822/3rdparty/libprocess/src/io.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/io.cpp b/3rdparty/libprocess/src/io.cpp
index 2bb8793..8a6a791 100644
--- a/3rdparty/libprocess/src/io.cpp
+++ b/3rdparty/libprocess/src/io.cpp
@@ -102,7 +102,7 @@ void read(
 
 void write(
     int fd,
-    void* data,
+    const void* data,
     size_t size,
     const std::shared_ptr<Promise<size_t>>& promise,
     const Future<short>& future)
@@ -227,7 +227,7 @@ Future<size_t> read(int fd, void* data, size_t size)
 }
 
 
-Future<size_t> write(int fd, void* data, size_t size)
+Future<size_t> write(int fd, const void* data, size_t size)
 {
   process::initialize();
 
@@ -341,7 +341,7 @@ Future<Nothing> _write(
     Owned<string> data,
     size_t index)
 {
-  return io::write(fd, (void*) (data->data() + index), data->size() - index)
+  return io::write(fd, data->data() + index, data->size() - index)
     .then([=](size_t length) -> Future<Nothing> {
       if (index + length == data->size()) {
         return Nothing();