You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2017/11/20 17:31:25 UTC

[trafficserver] branch master updated: Fixed build on Ubuntu, errors ignoring return value

This is an automated email from the ASF dual-hosted git repository.

bcall 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 2aee00a  Fixed build on Ubuntu, errors ignoring return value
2aee00a is described below

commit 2aee00aac9f1b8633143edc2e0adc01f64e737b8
Author: Bryan Call <bc...@apache.org>
AuthorDate: Sat Nov 18 10:21:47 2017 +0800

    Fixed build on Ubuntu, errors ignoring return value
---
 cmd/traffic_layout/engine.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/cmd/traffic_layout/engine.cc b/cmd/traffic_layout/engine.cc
index 15ab39c..2879634 100644
--- a/cmd/traffic_layout/engine.cc
+++ b/cmd/traffic_layout/engine.cc
@@ -30,6 +30,7 @@
 #include "ts/ink_args.h"
 #include "ts/I_Version.h"
 #include "ts/ink_file.h"
+#include "ts/ink_assert.h"
 
 #include "engine.h"
 #include "file_system.h"
@@ -193,16 +194,18 @@ RunrootEngine::runroot_parse()
   }
 }
 
-// for cleanning the parent of bin / cwd
+// for cleaning the parent of bin / cwd
 // return the path if we can clean the bin / cwd
 const static std::string
 clean_parent(const std::string &bin_path)
 {
   char cwd[MAX_CWD_LEN];
-  getcwd(cwd, sizeof(cwd));
+  ink_release_assert(getcwd(cwd, sizeof(cwd)) == nullptr);
 
   char resolved_binpath[MAX_CWD_LEN];
-  realpath(bin_path.c_str(), resolved_binpath); // bin path
+  if (realpath(bin_path.c_str(), resolved_binpath) == nullptr) { // bin path
+    return "";
+  }
   std::string RealBinPath = resolved_binpath;
 
   std::vector<std::string> TwoPath = {RealBinPath, cwd};

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