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/mpm/prefork prefork.c
Date Tue, 09 Jan 2001 04:40:22 GMT
trawick     01/01/08 20:40:22

  Modified:    server/mpm/dexter scoreboard.c
               server/mpm/mpmt_pthread scoreboard.c
               server/mpm/perchild scoreboard.c
               server/mpm/prefork prefork.c
  Log:
  get rid of some bogus uses of perror()
  
  Revision  Changes    Path
  1.24      +8 -5      httpd-2.0/server/mpm/dexter/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/dexter/scoreboard.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- scoreboard.c	2000/12/02 07:08:08	1.23
  +++ scoreboard.c	2001/01/09 04:40:21	1.24
  @@ -99,20 +99,23 @@
   static void setup_shared_mem(apr_pool_t *p)
   {
       char buf[512];
  +    char errmsg[120];
       const char *fname;
  +    apr_status_t rv;
   
       fname = ap_server_root_relative(p, ap_scoreboard_fname);
  -    if (apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p) != APR_SUCCESS) {
  -        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
  -                    ap_server_argv0);
  -        perror(buf);
  +    rv = apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p);
  +    if (rv != APR_SUCCESS) {
  +        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard: %s",
  +                    ap_server_argv0, apr_strerror(rv, errmsg, sizeof errmsg));
  +        fprintf(stderr, "%s\n", buf);
           exit(APEXIT_INIT);
       }
       ap_scoreboard_image = apr_shm_malloc(scoreboard_shm, SCOREBOARD_SIZE);
       if (ap_scoreboard_image == NULL) {
           apr_snprintf(buf, sizeof(buf), "%s: cannot allocate scoreboard",
                       ap_server_argv0);
  -        perror(buf);
  +        perror(buf); /* o.k. since MM sets errno */
           apr_shm_destroy(scoreboard_shm);
           exit(APEXIT_INIT);
       }
  
  
  
  1.44      +13 -9     httpd-2.0/server/mpm/mpmt_pthread/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/mpmt_pthread/scoreboard.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- scoreboard.c	2000/12/02 07:08:09	1.43
  +++ scoreboard.c	2001/01/09 04:40:21	1.44
  @@ -106,27 +106,31 @@
   static void setup_shared_mem(apr_pool_t *p)
   {
       char buf[512];
  +    char errmsg[120];
       const char *fname;
  +    apr_status_t rv;
   
       fname = ap_server_root_relative(p, ap_scoreboard_fname);
  -    if (apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p) != APR_SUCCESS) {
  -        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
  -                    ap_server_argv0);
  -        perror(buf);
  +    rv = apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p);
  +    if (rv != APR_SUCCESS) {
  +        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard: %s",
  +                    ap_server_argv0, apr_strerror(rv, errmsg, sizeof errmsg));
  +        fprintf(stderr, "%s\n", buf);
           exit(APEXIT_INIT);
       }
       ap_scoreboard_image = apr_shm_malloc(scoreboard_shm, SCOREBOARD_SIZE);
  -    if (apr_shm_init(&status_shm, NEW_SCOREBOARD_SIZE, fname, p) != APR_SUCCESS) {
  -        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
  -                    ap_server_argv0);
  -        perror(buf);
  +    rv = apr_shm_init(&status_shm, NEW_SCOREBOARD_SIZE, fname, p);
  +    if (rv != APR_SUCCESS) {
  +        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard: %s",
  +                    ap_server_argv0, apr_strerror(rv, errmsg, sizeof errmsg));
  +        fprintf(stderr, "%s\n", buf);
           exit(APEXIT_INIT);
       }
       ap_new_scoreboard_image = apr_shm_malloc(status_shm, NEW_SCOREBOARD_SIZE);
       if (ap_scoreboard_image == NULL || ap_new_scoreboard_image == NULL) {
           apr_snprintf(buf, sizeof(buf), "%s: cannot allocate scoreboard",
                       ap_server_argv0);
  -        perror(buf);
  +        perror(buf); /* o.k. since MM sets errno */
           apr_shm_destroy(scoreboard_shm);
           apr_shm_destroy(status_shm);
           exit(APEXIT_INIT);
  
  
  
  1.6       +8 -5      httpd-2.0/server/mpm/perchild/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/scoreboard.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- scoreboard.c	2000/12/02 07:08:11	1.5
  +++ scoreboard.c	2001/01/09 04:40:22	1.6
  @@ -99,20 +99,23 @@
   static void setup_shared_mem(apr_pool_t *p)
   {
       char buf[512];
  +    char errmsg[120];
       const char *fname;
  +    apr_status_t rv;
   
       fname = ap_server_root_relative(p, ap_scoreboard_fname);
  -    if (apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p) != APR_SUCCESS) {
  -        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
  -                    ap_server_argv0);
  -        perror(buf);
  +    rv = apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p);
  +    if (rv != APR_SUCCESS) {
  +        apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard: %s",
  +                    ap_server_argv0, apr_strerror(rv, errmsg, sizeof errmsg));
  +        fprintf(stderr, "%s\n", buf);
           exit(APEXIT_INIT);
       }
       ap_scoreboard_image = apr_shm_malloc(scoreboard_shm, SCOREBOARD_SIZE);
       if (ap_scoreboard_image == NULL) {
           apr_snprintf(buf, sizeof(buf), "%s: cannot allocate scoreboard",
                       ap_server_argv0);
  -        perror(buf);
  +        perror(buf); /* o.k. since MM sets errno */
           apr_shm_destroy(scoreboard_shm);
           exit(APEXIT_INIT);
       }
  
  
  
  1.141     +13 -9     httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.140
  retrieving revision 1.141
  diff -u -r1.140 -r1.141
  --- prefork.c	2001/01/07 19:55:59	1.140
  +++ prefork.c	2001/01/09 04:40:22	1.141
  @@ -337,27 +337,31 @@
   static void setup_shared_mem(apr_pool_t *p)
   {
       char buf[512];
  +    char errmsg[120];
       const char *fname;
  +    apr_status_t rv;
   
       fname = ap_server_root_relative(p, ap_scoreboard_fname);
  -    if (apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p) != APR_SUCCESS) {
  -	apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
  -		    ap_server_argv0);
  -	perror(buf);
  +    rv = apr_shm_init(&scoreboard_shm, SCOREBOARD_SIZE, fname, p);
  +    if (rv != APR_SUCCESS) {
  +	apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard: %s",
  +		    ap_server_argv0, apr_strerror(rv, errmsg, sizeof errmsg));
  +	fprintf(stderr, "%s\n", buf);
   	exit(APEXIT_INIT);
       }
       ap_scoreboard_image = apr_shm_malloc(scoreboard_shm, SCOREBOARD_SIZE); 
  -    if (apr_shm_init(&status_shm, NEW_SCOREBOARD_SIZE, fname, p) != APR_SUCCESS) {
  -	apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
  -		    ap_server_argv0);
  -	perror(buf);
  +    rv = apr_shm_init(&status_shm, NEW_SCOREBOARD_SIZE, fname, p);
  +    if (rv != APR_SUCCESS) {
  +	apr_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard: %s",
  +		    ap_server_argv0, apr_strerror(rv, errmsg, sizeof errmsg));
  +	fprintf(stderr, "%s\n", buf);
   	exit(APEXIT_INIT);
       }
       ap_new_scoreboard_image = apr_shm_malloc(status_shm, NEW_SCOREBOARD_SIZE); 
       if (ap_scoreboard_image == NULL || ap_new_scoreboard_image == NULL) {
   	apr_snprintf(buf, sizeof(buf), "%s: cannot allocate scoreboard",
   		    ap_server_argv0);
  -	perror(buf);
  +	perror(buf); /* o.k. since MM sets errno */
           apr_shm_destroy(scoreboard_shm);
           apr_shm_destroy(status_shm);
           exit(APEXIT_INIT);
  
  
  

Mime
View raw message