trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject trafficserver git commit: Use stat(2) macros
Date Mon, 05 Jan 2015 17:22:32 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master ee52084e3 -> 3f52f0c0d


Use stat(2) macros


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

Branch: refs/heads/master
Commit: 3f52f0c0d2688e0ef577d1355879a9e8a5e89084
Parents: ee52084
Author: James Peach <jpeach@apache.org>
Authored: Mon Jan 5 09:22:11 2015 -0800
Committer: James Peach <jpeach@apache.org>
Committed: Mon Jan 5 09:22:11 2015 -0800

----------------------------------------------------------------------
 mgmt/web2/WebIntrMain.cc   | 4 ++--
 proxy/logging/LogObject.cc | 2 +-
 proxy/logging/LogUtils.cc  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3f52f0c0/mgmt/web2/WebIntrMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/web2/WebIntrMain.cc b/mgmt/web2/WebIntrMain.cc
index e757372..d356854 100644
--- a/mgmt/web2/WebIntrMain.cc
+++ b/mgmt/web2/WebIntrMain.cc
@@ -105,7 +105,7 @@ checkWebContext(WebContext * wctx, const char *desc)
     return 1;
   }
 
-  if (!(fInfo.st_mode & S_IFDIR)) {
+  if (!S_ISDIR(fInfo.st_mode)) {
     mgmt_log(stderr, "[checkWebContext] Document root '%s' for %s is not a directory\n",
wctx->docRoot, desc);
     return 1;
   }
@@ -124,7 +124,7 @@ checkWebContext(WebContext * wctx, const char *desc)
     return 1;
   }
 
-  if (!(fInfo.st_mode & S_IFREG)) {
+  if (!S_ISREG(fInfo.st_mode)) {
     mgmt_log(stderr, "[checkWebContext] Default document for %s is not a file\n", desc);
     return 1;
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3f52f0c0/proxy/logging/LogObject.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc
index cd1c108..a3d1fca 100644
--- a/proxy/logging/LogObject.cc
+++ b/proxy/logging/LogObject.cc
@@ -1045,7 +1045,7 @@ LogObjectManager::_solve_filename_conflicts(LogObject * log_object,
int maxConfl
             retVal = ERROR_DETERMINING_FILE_INFO;
             roll_file = false;
           } else {
-            if (s.st_mode == S_IFIFO) {
+            if (S_ISFIFO(s.st_mode)) {
               unlink(filename);
               roll_file = false;
             }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3f52f0c0/proxy/logging/LogUtils.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogUtils.cc b/proxy/logging/LogUtils.cc
index dd8060b..f0d9a59 100644
--- a/proxy/logging/LogUtils.cc
+++ b/proxy/logging/LogUtils.cc
@@ -495,7 +495,7 @@ LogUtils::file_is_writeable(const char *full_filename,
     // stat succeeded, check if full_filename points to a regular
     // file/fifo and if so, check if file has write permission
     //
-    if (!(stat_data.st_mode & S_IFREG || stat_data.st_mode & S_IFIFO)) {
+    if (!(S_ISREG(stat_data.st_mode) || S_ISFIFO(stat_data.st_mode))) {
       ret_val = 1;
     } else if (!(stat_data.st_mode & S_IWUSR)) {
       errno = EACCES;


Mime
View raw message