You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/04/06 18:11:34 UTC

cvs commit: apache-2.0/src/lib/apr/file_io/unix dir.c filestat.c open.c pipe.c

rbb         00/04/06 09:11:33

  Modified:    src/lib/apr/file_io/unix dir.c filestat.c open.c pipe.c
  Log:
  Backout the if (cont == NULL) checks.  When a context == NULL, APR
  allocates memory using malloc.  These checks are returning an error
  instead of allocating memory.
  Submitted by:	Jeff Trawick <tr...@bellsouth.net>
  Reviewed by:	Ryan Bloom
  
  Revision  Changes    Path
  1.25      +0 -11     apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- dir.c	2000/04/03 19:44:29	1.24
  +++ dir.c	2000/04/06 16:11:32	1.25
  @@ -77,8 +77,6 @@
   {
       if (new == NULL)
           return APR_EBADARG;
  -    if (cont == NULL)
  -        return APR_ENOCONT;
   
       (*new) = (ap_dir_t *)ap_palloc(cont, sizeof(ap_dir_t));
   
  @@ -180,9 +178,6 @@
   {
       mode_t mode = get_fileperms(perm);
   
  -    if (cont == NULL) 
  -        return APR_ENOCONT;
  -
       if (mkdir(path, mode) == 0) {
           return APR_SUCCESS;
       }
  @@ -199,9 +194,6 @@
    */                        
   ap_status_t ap_remove_dir(const char *path, ap_context_t *cont)
   {
  -    if (cont == NULL)
  -        return APR_ENOCONT;
  -
       if (rmdir(path) == 0) {
           return APR_SUCCESS;
       }
  @@ -360,9 +352,6 @@
   ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir,
                             ap_context_t *cont)
   {
  -    if (cont == NULL) {
  -        return APR_ENOCONT;
  -    }
       if ((*dir) == NULL) {
           (*dir) = (ap_dir_t *)ap_palloc(cont, sizeof(ap_dir_t));
           (*dir)->cntxt = cont;
  
  
  
  1.20      +0 -3      apache-2.0/src/lib/apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- filestat.c	2000/04/03 19:44:30	1.19
  +++ filestat.c	2000/04/06 16:11:33	1.20
  @@ -133,9 +133,6 @@
       if(finfo == NULL || fname == NULL)
           return APR_EBADARG;
   
  -    if(cont == NULL)
  -        return APR_ENOCONT;
  -
       if ((rv = stat(fname, &info)) == 0) {
           finfo->protection = info.st_mode;
           finfo->filetype = filetype_from_mode(info.st_mode);
  
  
  
  1.39      +0 -9      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.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- open.c	2000/04/06 00:21:04	1.38
  +++ open.c	2000/04/06 16:11:33	1.39
  @@ -108,9 +108,6 @@
       if (new == NULL)
           return APR_EBADARG;
   
  -    if (cont == NULL)
  -        return APR_ENOCONT;
  -
       if ((*new) == NULL) {
           (*new) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t));
       }
  @@ -220,9 +217,6 @@
    */
   ap_status_t ap_remove_file(char *path, ap_context_t *cont)
   {
  -    if (cont == NULL)
  -        return APR_ENOCONT;
  -
       if (unlink(path) == 0) {
           return APR_SUCCESS;
       }
  @@ -274,9 +268,6 @@
       
       if (file == NULL || thefile == NULL)
           return APR_EBADARG;
  -
  -    if (cont == NULL)
  -        return APR_ENOCONT;
   
       if ((*file) == NULL) {
           (*file) = ap_pcalloc(cont, sizeof(ap_file_t));
  
  
  
  1.21      +0 -6      apache-2.0/src/lib/apr/file_io/unix/pipe.c
  
  Index: pipe.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/pipe.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- pipe.c	2000/04/04 17:11:27	1.20
  +++ pipe.c	2000/04/06 16:11:33	1.21
  @@ -111,9 +111,6 @@
       if(in == NULL || out == NULL)
           return APR_EBADARG;
   
  -    if(cont == NULL)
  -        return APR_ENOCONT;
  -
       if (pipe(filedes) == -1) {
           return errno;
       }
  @@ -152,9 +149,6 @@
                                   ap_fileperms_t perm, ap_context_t *cont)
   {
       mode_t mode = get_fileperms(perm);
  -
  -    if(cont == NULL)
  -        return APR_ENOCONT;
   
       if (mkfifo(filename, mode) == -1) {
           return errno;