Commit fc139b17 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

get rid of some bogus uses of perror()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87620 13f79535-47bb-0310-9956-ffa450edef68
parent 1b83205d
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -1297,6 +1297,8 @@ void ap_process_resource_config(server_rec *s, const char *fname,
	int current;
	int current;
	apr_array_header_t *candidates = NULL;
	apr_array_header_t *candidates = NULL;
	fnames *fnew;
	fnames *fnew;
        apr_status_t rv;
        char errmsg[120];


	/*
	/*
	 * first course of business is to grok all the directory
	 * first course of business is to grok all the directory
@@ -1304,10 +1306,11 @@ void ap_process_resource_config(server_rec *s, const char *fname,
	 * for this.
	 * for this.
	 */
	 */
	fprintf(stderr, "Processing config directory: %s\n", fname);
	fprintf(stderr, "Processing config directory: %s\n", fname);
	if (apr_dir_open(&dirp, fname, p) != APR_SUCCESS) {
        rv = apr_dir_open(&dirp, fname, p);
	    perror("fopen");
        if (rv != APR_SUCCESS) {
	    fprintf(stderr, "%s: could not open config directory %s\n",
	    fprintf(stderr, "%s: could not open config directory %s: %s\n",
		ap_server_argv0, fname);
                    ap_server_argv0, fname,
                    apr_strerror(rv, errmsg, sizeof errmsg));
	    exit(1);
	    exit(1);
	}
	}
	candidates = apr_make_array(p, 1, sizeof(fnames));
	candidates = apr_make_array(p, 1, sizeof(fnames));
+11 −17
Original line number Original line Diff line number Diff line
@@ -188,7 +188,7 @@ static int log_child(apr_pool_t *p, const char *progname,
     * may want a common framework for this, since I expect it will
     * may want a common framework for this, since I expect it will
     * be common for other foo-loggers to want this sort of thing...
     * be common for other foo-loggers to want this sort of thing...
     */
     */
    int rc = -1;
    apr_status_t rc;
    apr_procattr_t *procattr;
    apr_procattr_t *procattr;
    apr_proc_t *procnew;
    apr_proc_t *procnew;


@@ -197,15 +197,11 @@ static int log_child(apr_pool_t *p, const char *progname,
    apr_signal(SIGHUP, SIG_IGN);
    apr_signal(SIGHUP, SIG_IGN);
#endif /* ndef SIGHUP */
#endif /* ndef SIGHUP */


    if ((apr_createprocattr_init(&procattr, p) != APR_SUCCESS) ||
    if (((rc = apr_createprocattr_init(&procattr, p)) == APR_SUCCESS) &&
        (apr_setprocattr_io(procattr,
        ((rc = apr_setprocattr_io(procattr,
                                  APR_FULL_BLOCK,
                                  APR_FULL_BLOCK,
                                  APR_NO_PIPE,
                                  APR_NO_PIPE,
                           APR_NO_PIPE) != APR_SUCCESS)) {
                                  APR_NO_PIPE)) == APR_SUCCESS)) {
        /* Something bad happened, give up and go away. */
        rc = -1;
    }
    else {
        char **args;
        char **args;
        const char *pname;
        const char *pname;
        
        
@@ -235,9 +231,8 @@ static void open_error_log(server_rec *s, apr_pool_t *p)
        /* This starts a new process... */
        /* This starts a new process... */
        rc = log_child (p, s->error_fname+1, &dummy);
        rc = log_child (p, s->error_fname+1, &dummy);
        if (rc != APR_SUCCESS) {
        if (rc != APR_SUCCESS) {
	    perror("ap_spawn_child");
	    ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, 
	    ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                         "Couldn't start ErrorLog process");
                         "Couldn't fork child for ErrorLog process");
            exit(1);
            exit(1);
	}
	}


@@ -735,9 +730,8 @@ AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p, const char *program)


    rc = log_child(p, program, &dummy);
    rc = log_child(p, program, &dummy);
    if (rc != APR_SUCCESS) {
    if (rc != APR_SUCCESS) {
	perror("ap_spawn_child");
	ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, 
	ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                     "Couldn't start piped log process");
                     "Couldn't fork child for piped log process");
	exit (1);
	exit (1);
    }
    }