You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/10/31 16:18:21 UTC
[02/17] git commit: TS-2302: remove ASCII_PIPE_FORMAT_SUPPORTED
TS-2302: remove ASCII_PIPE_FORMAT_SUPPORTED
ASCII_PIPE_FORMAT_SUPPORTED was used to only support logging to
pipes on Linux and Solaris. All the platforms we support have named
pipe support, so we should always enable this.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/81b3622f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/81b3622f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/81b3622f
Branch: refs/heads/master
Commit: 81b3622f8f109ec8348774ac36512ccd70ef40ab
Parents: 6295353
Author: James Peach <jp...@apache.org>
Authored: Wed Sep 25 13:53:56 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu Oct 31 08:16:27 2013 -0700
----------------------------------------------------------------------
proxy/logging/LogFile.cc | 5 -----
proxy/logging/LogFormatType.h | 4 ----
proxy/logging/LogObject.cc | 9 ---------
proxy/logging/LogUtils.cc | 4 ----
4 files changed, 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/81b3622f/proxy/logging/LogFile.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index a567b93..dc564e6 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -220,7 +220,6 @@ LogFile::open_file()
int flags, perms;
if (m_file_format == ASCII_PIPE) {
-#ifdef ASCII_PIPE_FORMAT_SUPPORTED
if (mkfifo(m_name, S_IRUSR | S_IWUSR) < 0) {
if (errno != EEXIST) {
Error("Could not create named pipe %s for logging: %s", m_name, strerror(errno));
@@ -231,10 +230,6 @@ LogFile::open_file()
}
flags = O_WRONLY | O_NDELAY;
perms = 0;
-#else
- Error("ASCII_PIPE mode not supported, could not create named pipe %s" " for logging", m_name);
- return LOG_FILE_PIPE_MODE_NOT_SUPPORTED;
-#endif
} else {
flags = O_WRONLY | O_APPEND | O_CREAT;
perms = Log::config->logfile_perm;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/81b3622f/proxy/logging/LogFormatType.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFormatType.h b/proxy/logging/LogFormatType.h
index 495a6ae..3c68449 100644
--- a/proxy/logging/LogFormatType.h
+++ b/proxy/logging/LogFormatType.h
@@ -45,8 +45,4 @@ enum LogFileFormat
N_LOGFILE_TYPES
};
-#if defined(linux) || defined(solaris)
-#define ASCII_PIPE_FORMAT_SUPPORTED
-#endif
-
#endif
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/81b3622f/proxy/logging/LogObject.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc
index f68e1b7..ce86692 100644
--- a/proxy/logging/LogObject.cc
+++ b/proxy/logging/LogObject.cc
@@ -100,14 +100,7 @@ LogObject::LogObject(LogFormat *format, const char *log_dir,
if (file_format == BINARY_LOG) {
m_flags |= BINARY;
} else if (file_format == ASCII_PIPE) {
-#ifdef ASCII_PIPE_FORMAT_SUPPORTED
m_flags |= WRITES_TO_PIPE;
-#else
- // ASCII_PIPE not supported, reset to ASCII_LOG
- Warning("ASCII_PIPE Mode not supported, resetting Mode to ASCII_LOG "
- "for LogObject %s", basename);
- file_format = ASCII_LOG;
-#endif
}
generate_filenames(log_dir, basename, file_format);
@@ -1040,7 +1033,6 @@ LogObjectManager::_solve_filename_conflicts(LogObject * log_object, int maxConfl
bool roll_file = true;
-#ifdef ASCII_PIPE_FORMAT_SUPPORTED
if (log_object->writes_to_pipe()) {
// determine if existing file is a pipe, and remove it if
// that is the case so the right metadata for the new pipe
@@ -1064,7 +1056,6 @@ LogObjectManager::_solve_filename_conflicts(LogObject * log_object, int maxConfl
}
}
}
-#endif
if (roll_file) {
Warning("File %s will be rolled because a LogObject with "
"different format is requesting the same " "filename", filename);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/81b3622f/proxy/logging/LogUtils.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogUtils.cc b/proxy/logging/LogUtils.cc
index 5fadb14..5104d36 100644
--- a/proxy/logging/LogUtils.cc
+++ b/proxy/logging/LogUtils.cc
@@ -506,11 +506,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
//
-#ifdef ASCII_PIPE_FORMAT_SUPPORTED
if (!(stat_data.st_mode & S_IFREG || stat_data.st_mode & S_IFIFO)) {
-#else
- if (!(stat_data.st_mode & S_IFREG)) {
-#endif
ret_val = 1;
} else if (!(stat_data.st_mode & S_IWUSR)) {
errno = EACCES;