You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gs...@locus.apache.org on 2000/10/07 00:50:54 UTC

cvs commit: apache-2.0/src/lib/apr/file_io/win32 open.c

gstein      00/10/06 15:50:54

  Modified:    src/lib/apr/file_io/unix open.c
               src/lib/apr/file_io/win32 open.c
  Log:
  apr_open() always allocates storage for the apr_file_t now. The caller is no
  longer responsible for initializing their apr_file_t* to NULL.
  
  Revision  Changes    Path
  1.65      +1 -4      apache-2.0/src/lib/apr/file_io/unix/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- open.c	2000/09/11 18:27:57	1.64
  +++ open.c	2000/10/06 22:50:53	1.65
  @@ -85,10 +85,7 @@
       apr_status_t rv;
   #endif
   
  -    if ((*new) == NULL) {
  -        (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t));
  -    }
  -
  +    (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t));
       (*new)->cntxt = cont;
       (*new)->oflags = oflags;
       (*new)->filedes = -1;
  
  
  
  1.50      +1 -4      apache-2.0/src/lib/apr/file_io/win32/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/open.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- open.c	2000/10/06 17:24:38	1.49
  +++ open.c	2000/10/06 22:50:54	1.50
  @@ -85,10 +85,7 @@
       apr_oslevel_e level;
       apr_status_t rv;
   
  -    if ((*new) == NULL) {
  -        (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t));
  -    }
  -
  +    (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t));
       (*new)->cntxt = cont;
   
       if (flag & APR_READ) {
  
  
  

Re: cvs commit: apache-2.0/src/lib/apr/file_io/win32 open.c

Posted by rb...@covalent.net.
> >   apr_open() always allocates storage for the apr_file_t now. The caller is no
> >   longer responsible for initializing their apr_file_t* to NULL.
> 
> Does anybody feel it is important to clear out all the NULL initializations
> throughout Apache? I have them handy, but am tempted to just leave them as
> is. Especially for that odd case where the NULL status is used as an error
> cleanup situation ("I didn't open the file yet").
> 
> Thoughts?

I am always much more comfortable with initializing variables.  If we are
going to remove these, can it wait until after Sunday?  I would prefer we
didn't break things this close to an alpha.  At least not any more than
they already are.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: cvs commit: apache-2.0/src/lib/apr/file_io/win32 open.c

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Oct 06, 2000 at 10:50:54PM -0000, gstein@locus.apache.org wrote:
> gstein      00/10/06 15:50:54
> 
>   Modified:    src/lib/apr/file_io/unix open.c
>                src/lib/apr/file_io/win32 open.c
>   Log:
>   apr_open() always allocates storage for the apr_file_t now. The caller is no
>   longer responsible for initializing their apr_file_t* to NULL.

Does anybody feel it is important to clear out all the NULL initializations
throughout Apache? I have them handy, but am tempted to just leave them as
is. Especially for that odd case where the NULL status is used as an error
cleanup situation ("I didn't open the file yet").

Thoughts?

[ and certainly: as we work near those apr_open() calls, we can toss the
  NULL stuff ]

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/