httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@locus.apache.org
Subject cvs commit: apache-2.0/src/support htpasswd.c
Date Fri, 06 Oct 2000 17:52:47 GMT
wrowe       00/10/06 10:52:46

  Modified:    src/lib/apr/shmem/unix/mm mm_core.c
               src/lib/apr/threadproc/win32 thread.c
               src/modules/dav/fs repos.c
               src/modules/file_cache cache_util.c file_cache.c
                        file_garbage.c
               src/modules/mpm/prefork prefork.c
               src/modules/standard mod_cern_meta.c mod_cgid.c
               src/support htpasswd.c
  Log:
    Completed review for new tests:
      APR_STATUS_IS_EACCES(s)
      APR_STATUS_IS_EEXIST(s)
      APR_STATUS_IS_ENAMETOOLONG(s)
      APR_STATUS_IS_ENOENT(s)
  
    Where the old EACCES et. al. still exist, we have a problem (not yet
    using APR at all)
  
    More to come...
  
  Revision  Changes    Path
  1.7       +2 -2      apache-2.0/src/lib/apr/shmem/unix/mm/mm_core.c
  
  Index: mm_core.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/shmem/unix/mm/mm_core.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mm_core.c	2000/05/03 17:15:49	1.6
  +++ mm_core.c	2000/10/06 17:52:44	1.7
  @@ -315,14 +315,14 @@
   
   #if defined(MM_SEMT_IPCSEM)
       fdsem = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR);
  -    if (fdsem == -1 && errno == EEXIST)
  +    if (fdsem == -1 && APR_STATUS_IS_EEXIST(errno))
           fdsem = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR);
           if (fdsem == -1)
               FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore");
       mm_core_semctlarg.val = 0;
       semctl(fdsem, 0, SETVAL, mm_core_semctlarg);
       fdsem_rd = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR);
  -    if (fdsem_rd == -1 && errno == EEXIST)
  +    if (fdsem_rd == -1 && APR_STATUS_IS_EEXIST(errno))
           fdsem_rd = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR);
           if (fdsem_rd == -1)
               FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore");
  
  
  
  1.25      +4 -1      apache-2.0/src/lib/apr/threadproc/win32/thread.c
  
  Index: thread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/win32/thread.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- thread.c	2000/10/06 17:24:41	1.24
  +++ thread.c	2000/10/06 17:52:44	1.25
  @@ -114,7 +114,10 @@
       if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC
*)(void *))func,
                                                  data, 0, &temp)) == 0) {
           lasterror = apr_get_os_error();
  -        return APR_EEXIST; /* MSVC++ doc doesn't mention any additional error info */
  +        return APR_EEXIST; 
  +        /* MSVC++ doc doesn't mention any additional error info 
  +         * XXX: need to check the sources
  +         */
       }
   
       if (attr && attr->detach) {
  
  
  
  1.21      +1 -1      apache-2.0/src/modules/dav/fs/repos.c
  
  Index: repos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/fs/repos.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- repos.c	2000/09/09 23:23:40	1.20
  +++ repos.c	2000/10/06 17:52:44	1.21
  @@ -400,7 +400,7 @@
   
       /* ensure that it exists */
       if (apr_make_dir(dst, APR_OS_DEFAULT, p) != 0) {
  -	if (errno != EEXIST) {
  +	if (APR_STATUS_IS_EEXIST(errno)) {
   	    /* ### use something besides 500? */
   	    return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
   				 "Could not create internal state directory");
  
  
  
  1.6       +3 -3      apache-2.0/src/modules/file_cache/cache_util.c
  
  Index: cache_util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/file_cache/cache_util.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- cache_util.c	2000/09/10 20:45:17	1.5
  +++ cache_util.c	2000/10/06 17:52:45	1.6
  @@ -447,11 +447,11 @@
               break;
           *p = '\0';
   #ifdef WIN32
  -        if (mkdir(file) < 0 && errno != EEXIST)
  +        if (mkdir(file) < 0 && !APR_ERROR_IS_EEXIST(errno))
   #elif defined(__TANDEM)
  -            if (mkdir(file, S_IRWXU | S_IRWXG | S_IRWXO) < 0 && errno != EEXIST)
  +            if (mkdir(file, S_IRWXU | S_IRWXG | S_IRWXO) < 0 && !APR_ERROR_IS_EEXIST(errno))
   #else
  -                if (mkdir(file, S_IREAD | S_IWRITE | S_IEXEC) < 0 && errno !=
EEXIST)
  +                if (mkdir(file, S_IREAD | S_IWRITE | S_IEXEC) < 0 && !APR_ERROR_IS_EEXIST(errno))
   #endif /* WIN32 */
                       ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
                                    "cache: error creating cache directory %s",
  
  
  
  1.5       +6 -5      apache-2.0/src/modules/file_cache/file_cache.c
  
  Index: file_cache.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/file_cache/file_cache.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- file_cache.c	2000/09/10 20:45:17	1.4
  +++ file_cache.c	2000/10/06 17:52:45	1.5
  @@ -103,11 +103,11 @@
       case AP_CACHE_SEEK:
       {
           apr_file_t *fp = NULL;
  -        apr_status_t ret = APR_ENOENT;
  +        apr_status_t ret;
           char *data = data_file(h, name);
           *el_in = NULL;
  -        if((apr_open(&fp, data, APR_WRITE | APR_READ | APR_BINARY, 0, h->pool)
  -            == APR_SUCCESS))
  +        ret = apr_open(&fp, data, APR_WRITE | APR_READ | APR_BINARY, 0, h->pool);
  +        if (ret == APR_SUCCESS)
           {
               cache_req *cq = create_cache_el(h, name);
               cq->fp = fp;
  @@ -128,8 +128,9 @@
                   }
               }
           }
  -        else if(errno == APR_EACCES)
  -            ap_log_error(APLOG_MARK, APLOG_ERR, 0, h->server,
  +        /* XXX: is this the only case we care to report? */
  +        else if(APR_STATUS_IS_EACCES(ret))
  +            ap_log_error(APLOG_MARK, APLOG_ERR, ret, h->server,
                            "cache: cache entry couldn't be opened, perhaps permission error");
           return ret;
       }
  
  
  
  1.5       +1 -1      apache-2.0/src/modules/file_cache/file_garbage.c
  
  Index: file_garbage.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/file_cache/file_garbage.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- file_garbage.c	2000/08/06 06:07:38	1.4
  +++ file_garbage.c	2000/10/06 17:52:45	1.5
  @@ -308,7 +308,7 @@
               return 0;
           }
           if ((timefd = creat(filename, 0666)) == -1) {
  -            if (errno != EEXIST)
  +            if (!APR_ERROR_IS_EEXIST(errno))
                   ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                                "cache: creat(%s)", filename);
               else
  
  
  
  1.129     +1 -1      apache-2.0/src/modules/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
  retrieving revision 1.128
  retrieving revision 1.129
  diff -u -r1.128 -r1.129
  --- prefork.c	2000/09/08 14:59:33	1.128
  +++ prefork.c	2000/10/06 17:52:45	1.129
  @@ -214,7 +214,7 @@
   	    apr_snprintf(buf, sizeof(buf), "%sgprof.%d", dir, (int)getpid());
   	} 
   	dir = ap_server_root_relative(pconf, buf[0] ? buf : dir);
  -	if(mkdir(dir, 0755) < 0 && errno != EEXIST) {
  +	if(mkdir(dir, 0755) < 0 && !APR_ERROR_IS_EEXIST(errno)) {
   	    ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
   			 "gprof: error creating directory %s", dir);
   	}
  
  
  
  1.22      +1 -1      apache-2.0/src/modules/standard/mod_cern_meta.c
  
  Index: mod_cern_meta.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cern_meta.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_cern_meta.c	2000/08/09 20:47:06	1.21
  +++ mod_cern_meta.c	2000/10/06 17:52:46	1.22
  @@ -368,7 +368,7 @@
   
       retcode = apr_open(&f, metafilename, APR_READ | APR_CREATE, APR_OS_DEFAULT, r->pool);
       if (retcode != APR_SUCCESS) {
  -	if (errno == ENOENT) {
  +	if (APR_STATUS_IS_ENOENT(retcode)) {
   	    return DECLINED;
   	}
   	ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  
  
  
  1.43      +1 -2      apache-2.0/src/modules/standard/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgid.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- mod_cgid.c	2000/09/22 11:37:05	1.42
  +++ mod_cgid.c	2000/10/06 17:52:46	1.43
  @@ -524,8 +524,7 @@
                          main_server->module_config, &cgid_module); 
   
       apr_signal(SIGCHLD, SIG_IGN); 
  -    if (unlink(sconf->sockname) < 0 &&
  -        errno != ENOENT) {
  +    if (unlink(sconf->sockname) < 0 && errno == ENOENT) {
           ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
                        "Couldn't unlink unix domain socket %s",
                        sconf->sockname);
  
  
  
  1.22      +2 -2      apache-2.0/src/support/htpasswd.c
  
  Index: htpasswd.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/htpasswd.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- htpasswd.c	2000/08/07 19:26:02	1.21
  +++ htpasswd.c	2000/10/06 17:52:46	1.22
  @@ -335,10 +335,10 @@
   static int exists(char *fname)
   {
       apr_finfo_t sbuf;
  -    int check;
  +    apr_status_t check;
   
       check = apr_stat(&sbuf, fname, NULL);
  -    return ((check == -1) && (errno == ENOENT)) ? 0 : 1;
  +    return (check ? 0 : 1);
   }
   
   /*
  
  
  

Mime
View raw message