Github user jpeach commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/568#discussion_r59631163 --- Diff: lib/ts/Diags.cc --- @@ -853,29 +867,39 @@ Diags::set_stderr_output(const char *_bind_stderr) if (strcmp(_bind_stderr, "") == 0) return false; - if (stderr_log) { - delete stderr_log; - stderr_log = NULL; - } - - // create backing BaseLogFile for stdout - stderr_log = new BaseLogFile(_bind_stderr); + BaseLogFile *old_stderr_log = stderr_log; + BaseLogFile *new_stderr_log = new BaseLogFile(_bind_stderr); // on any errors we quit - if (!stderr_log || stderr_log->open_file() != BaseLogFile::LOG_FILE_NO_ERROR) { + if (!new_stderr_log || new_stderr_log->open_file() != BaseLogFile::LOG_FILE_NO_ERROR) { fprintf(stderr, "[Warning]: unable to open file=%s to bind stderr to\n", _bind_stderr); - delete stderr_log; + fprintf(stderr, "[Warning]: stderr is currently not bound to anything\n"); + delete new_stderr_log; + lock(); stderr_log = NULL; + unlock(); return false; } - if (!stderr_log->m_fp) { + if (!new_stderr_log->m_fp) { --- End diff -- ``new_stderr_log->is_open()``
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---