You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2015/01/06 23:53:19 UTC
trafficserver git commit: Fix to make us check the main_fd on both
paths when opening a log file to parse.
Repository: trafficserver
Updated Branches:
refs/heads/master b52fc5aa6 -> 82f95638c
Fix to make us check the main_fd on both paths when opening
a log file to parse.
Coverity CID #1200012
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/82f95638
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/82f95638
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/82f95638
Branch: refs/heads/master
Commit: 82f95638c3d3ce314d64f2ec73019d1761e2d0b2
Parents: b52fc5a
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Jan 6 15:52:41 2015 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Jan 6 15:52:41 2015 -0700
----------------------------------------------------------------------
proxy/logstats.cc | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82f95638/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 1a18375..e8bb871 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -2533,15 +2533,11 @@ main(int /* argc ATS_UNUSED */, char *argv[])
close(main_fd);
close(state_fd);
} else {
- if (cl.log_file[0] != '\0') {
- main_fd = open(cl.log_file, O_RDONLY);
- if (main_fd < 0) {
- exit_status.set(EXIT_CRITICAL, " can't open log file ");
- exit_status.append(cl.log_file);
- my_exit(exit_status);
- }
- } else {
- main_fd = open_main_log(exit_status);
+ main_fd = cl.log_file[0] ? open(cl.log_file, O_RDONLY) : open_main_log(exit_status);
+ if (main_fd < 0) {
+ exit_status.set(EXIT_CRITICAL, " can't open log file ");
+ exit_status.append(cl.log_file);
+ my_exit(exit_status);
}
if (cl.tail > 0) {