You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2001/10/23 19:46:56 UTC

cvs commit: apr/locks/unix proc_mutex.c

trawick     01/10/23 10:46:56

  Modified:    locks/unix proc_mutex.c
  Log:
  return the error that caused the operation to fail, not the current
  errno, since that could have been set due to some cleanup which
  didn't work (like trying to close a file that was never opened in
  the first place)
  
  Revision  Changes    Path
  1.6       +1 -1      apr/locks/unix/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- proc_mutex.c	2001/10/19 23:25:28	1.5
  +++ proc_mutex.c	2001/10/23 17:46:56	1.6
  @@ -401,7 +401,7 @@
    
       if (rv != APR_SUCCESS) {
           proc_mutex_fcntl_cleanup(new_mutex);
  -        return errno;
  +        return rv;
       }
   
       new_mutex->curr_locked = 0;
  
  
  

Re: cvs commit: apr/locks/unix proc_mutex.c

Posted by Jeff Trawick <tr...@attglobal.net>.
Aaron Bannert <aa...@clove.org> writes:

> locks/unix/crossproc.c:392 is still using errno, should this be changed
> as well to only rely on apr_file_mktemp's return value?
> 
>     if (rv != APR_SUCCESS) {
>         apr_status_t stat = errno;
> 
>         fcntl_cleanup(new);
>         return stat;
>     }

you betcha...  

apr_file_open() and apr_file_mkstemp() have to return the right error
code (what caused the operation to fail), so rv has the right value
already.

Thanks,
-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: cvs commit: apr/locks/unix proc_mutex.c

Posted by Aaron Bannert <aa...@clove.org>.
On Tue, Oct 23, 2001 at 05:46:56PM -0000, trawick@apache.org wrote:
> trawick     01/10/23 10:46:56
> 
>   Modified:    locks/unix proc_mutex.c
>   Log:
>   return the error that caused the operation to fail, not the current
>   errno, since that could have been set due to some cleanup which
>   didn't work (like trying to close a file that was never opened in
>   the first place)
>   
>   Revision  Changes    Path
>   1.6       +1 -1      apr/locks/unix/proc_mutex.c
>   
>   Index: proc_mutex.c
>   ===================================================================
>   RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- proc_mutex.c	2001/10/19 23:25:28	1.5
>   +++ proc_mutex.c	2001/10/23 17:46:56	1.6
>   @@ -401,7 +401,7 @@
>     
>        if (rv != APR_SUCCESS) {
>            proc_mutex_fcntl_cleanup(new_mutex);
>   -        return errno;
>   +        return rv;
>        }
>    
>        new_mutex->curr_locked = 0;

locks/unix/crossproc.c:392 is still using errno, should this be changed
as well to only rely on apr_file_mktemp's return value?

    if (rv != APR_SUCCESS) {
        apr_status_t stat = errno;

        fcntl_cleanup(new);
        return stat;
    }

(also, as Roy brought up recently, we shouldn't be using "stat" as an
identifier. This was probably my fault, so I'll just fix it.)

-aaron