httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server config.c log.c
Date Tue, 09 Jan 2001 00:27:04 GMT
trawick     01/01/08 16:27:04

  Modified:    server   config.c log.c
  Log:
  get rid of some bogus uses of perror()
  
  Revision  Changes    Path
  1.98      +7 -4      httpd-2.0/server/config.c
  
  Index: config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/config.c,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- config.c	2001/01/08 23:55:10	1.97
  +++ config.c	2001/01/09 00:27:03	1.98
  @@ -1297,6 +1297,8 @@
   	int current;
   	apr_array_header_t *candidates = NULL;
   	fnames *fnew;
  +        apr_status_t rv;
  +        char errmsg[120];
   
   	/*
   	 * first course of business is to grok all the directory
  @@ -1304,10 +1306,11 @@
   	 * for this.
   	 */
   	fprintf(stderr, "Processing config directory: %s\n", fname);
  -	if (apr_dir_open(&dirp, fname, p) != APR_SUCCESS) {
  -	    perror("fopen");
  -	    fprintf(stderr, "%s: could not open config directory %s\n",
  -		ap_server_argv0, fname);
  +        rv = apr_dir_open(&dirp, fname, p);
  +        if (rv != APR_SUCCESS) {
  +	    fprintf(stderr, "%s: could not open config directory %s: %s\n",
  +                    ap_server_argv0, fname,
  +                    apr_strerror(rv, errmsg, sizeof errmsg));
   	    exit(1);
   	}
   	candidates = apr_make_array(p, 1, sizeof(fnames));
  
  
  
  1.80      +11 -17    httpd-2.0/server/log.c
  
  Index: log.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/log.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- log.c	2001/01/08 13:25:02	1.79
  +++ log.c	2001/01/09 00:27:03	1.80
  @@ -188,7 +188,7 @@
        * may want a common framework for this, since I expect it will
        * be common for other foo-loggers to want this sort of thing...
        */
  -    int rc = -1;
  +    apr_status_t rc;
       apr_procattr_t *procattr;
       apr_proc_t *procnew;
   
  @@ -197,15 +197,11 @@
       apr_signal(SIGHUP, SIG_IGN);
   #endif /* ndef SIGHUP */
   
  -    if ((apr_createprocattr_init(&procattr, p) != APR_SUCCESS) ||
  -        (apr_setprocattr_io(procattr,
  -                           APR_FULL_BLOCK,
  -                           APR_NO_PIPE,
  -                           APR_NO_PIPE) != APR_SUCCESS)) {
  -        /* Something bad happened, give up and go away. */
  -        rc = -1;
  -    }
  -    else {
  +    if (((rc = apr_createprocattr_init(&procattr, p)) == APR_SUCCESS) &&
  +        ((rc = apr_setprocattr_io(procattr,
  +                                  APR_FULL_BLOCK,
  +                                  APR_NO_PIPE,
  +                                  APR_NO_PIPE)) == APR_SUCCESS)) {
           char **args;
           const char *pname;
           
  @@ -235,10 +231,9 @@
           /* This starts a new process... */
           rc = log_child (p, s->error_fname+1, &dummy);
           if (rc != APR_SUCCESS) {
  -	    perror("ap_spawn_child");
  -	    ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
  -                         "Couldn't fork child for ErrorLog process");
  -	                 exit(1);
  +	    ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, 
  +                         "Couldn't start ErrorLog process");
  +            exit(1);
   	}
   
           s->error_log = dummy;
  @@ -735,9 +730,8 @@
   
       rc = log_child(p, program, &dummy);
       if (rc != APR_SUCCESS) {
  -	perror("ap_spawn_child");
  -	ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
  -                     "Couldn't fork child for piped log process");
  +	ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, 
  +                     "Couldn't start piped log process");
   	exit (1);
       }
   
  
  
  

Mime
View raw message