Github user SolidWallOfCode commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/274#discussion_r36769922 --- Diff: iocore/eventsystem/test_Event.cc --- @@ -91,23 +91,13 @@ reconfigure_diags() static void init_diags(const char *bdt, const char *bat) { - FILE *diags_log_fp; char diags_logpath[500]; strcpy(diags_logpath, DIAGS_LOG_FILE); - diags_log_fp = fopen(diags_logpath, "w"); - if (diags_log_fp) { - int status; - status = setvbuf(diags_log_fp, NULL, _IOLBF, 512); - if (status != 0) { - fclose(diags_log_fp); - diags_log_fp = NULL; - } - } - - diags = new Diags(bdt, bat, diags_log_fp); + BaseLogFile *blf = new BaseLogFile(diags_logpath); + diags = new Diags(bdt, bat, blf); - if (diags_log_fp == NULL) { + if (blf && blf->m_fp == NULL) { --- End diff -- How can `blf` be `NULL` since you just allocated it? And in that case the condition should be `NULL == blf || NULL == blf->m_fp` because if `blf` is NULL you're failed as well.
--- 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. ---