Bug 59981 - [patch] Add log message when apr_file_open_stdin/stdout fails
Summary: [patch] Add log message when apr_file_open_stdin/stdout fails
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: All (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-11 15:22 UTC by jiazhouyang
Modified: 2016-08-11 15:58 UTC (History)
0 users



Attachments
Add log message when apr_file_open_stdin/apr_file_open_stdout fails (693 bytes, patch)
2016-08-11 15:22 UTC, jiazhouyang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jiazhouyang 2016-08-11 15:22:29 UTC
Created attachment 34127 [details]
Add log message when apr_file_open_stdin/apr_file_open_stdout fails

Function apr_file_open_stdin/apr_file_open_stdout may fail. The majority of calls have checked the return value and printed log message like the following code snippet, while the others have not. Those unchecked ones probably need logs too (see attachment).

/* httpd-2.4.10/support/rotatelogs.c:625:9 */
    if (apr_file_open_stdin(&f_stdin, status.pool) != APR_SUCCESS) {
        fprintf(stderr, "Unable to open stdin\n");
        exit(1);
    }

    if (apr_file_open_stdout(&f_stdout, status.pool) != APR_SUCCESS) {
        fprintf(stderr, "Unable to open stdout\n");
        exit(1);
    }