trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dra...@apache.org
Subject [trafficserver] branch master updated: fix
Date Fri, 06 Oct 2017 19:29:29 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new b110731  fix
b110731 is described below

commit b11073122f833ac9fcc61fd1e9fc81c57ba42db8
Author: Xavier Chi <chitianhaoxp@gmail.com>
AuthorDate: Fri Oct 6 11:09:48 2017 -0500

    fix
---
 README                            | 2 +-
 cmd/traffic_layout/engine.cc      | 5 ++++-
 cmd/traffic_layout/file_system.cc | 4 +++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 20fe118..71d891d 100644
--- a/README
+++ b/README
@@ -78,7 +78,7 @@ plugins to build large scale web applications.
     openssl-devel
     tcl-devel
     pcre-devel
-    ncurses-devel and libcurl-devl(optional, needed for traffic_top)
+    ncurses-devel and libcurl-devel(optional, needed for traffic_top)
     libcap-devel (optional, highly recommended)
     hwloc-devel (optional, highly recommended)
     flex (optional, needed for e.g. WCCP)
diff --git a/cmd/traffic_layout/engine.cc b/cmd/traffic_layout/engine.cc
index 8cb2a32..e41da3e 100644
--- a/cmd/traffic_layout/engine.cc
+++ b/cmd/traffic_layout/engine.cc
@@ -200,7 +200,10 @@ clean_parent(const std::string &bin_path)
 {
   char cwd[MAX_CWD_LEN];
   getcwd(cwd, sizeof(cwd));
-  std::string RealBinPath = realpath(bin_path.c_str(), nullptr); // bin path
+
+  char resolved_binpath[MAX_CWD_LEN];
+  realpath(bin_path.c_str(), resolved_binpath); // bin path
+  std::string RealBinPath = resolved_binpath;
 
   std::vector<std::string> TwoPath = {RealBinPath, cwd};
   for (auto it : TwoPath) {
diff --git a/cmd/traffic_layout/file_system.cc b/cmd/traffic_layout/file_system.cc
index 8730f93..c4cba3d 100644
--- a/cmd/traffic_layout/file_system.cc
+++ b/cmd/traffic_layout/file_system.cc
@@ -164,7 +164,9 @@ copy_function(const char *src_path, const struct stat *sb, int flag)
       std::ifstream src(src_path, std::ios::binary);
       std::ofstream dst(dst_path, std::ios::binary);
       dst << src.rdbuf();
-      chmod(dst_path.c_str(), sb->st_mode);
+      if (chmod(dst_path.c_str(), sb->st_mode) == -1) {
+        ink_warning("failed chomd the destination path: %s", strerror(errno));
+      }
     }
   }
   return 0;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message