Bug 59981

Summary: [patch] Add log message when apr_file_open_stdin/stdout fails
Product: Apache httpd-2 Reporter: jiazhouyang
Component: AllAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Add log message when apr_file_open_stdin/apr_file_open_stdout fails

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);
    }