httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/misc/unix errorcodes.c
Date Fri, 21 Apr 2000 14:51:27 GMT
rbb         00/04/21 07:51:27

  Modified:    src/lib/apr/file_io/unix dir.c fileacc.c filedup.c
                        filestat.c open.c pipe.c readwrite.c
               src/lib/apr/include apr_errno.h
               src/lib/apr/misc/unix errorcodes.c
  Log:
  Remove the invalid data checking from APR's file I/O on Unix.
  
  Revision  Changes    Path
  1.31      +0 -24     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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- dir.c	2000/04/19 21:14:20	1.30
  +++ dir.c	2000/04/21 14:51:22	1.31
  @@ -68,9 +68,6 @@
   
   ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont)
   {
  -    if (new == NULL)
  -        return APR_EBADARG;
  -
       (*new) = (ap_dir_t *)ap_palloc(cont, sizeof(ap_dir_t));
   
       (*new)->cntxt = cont;
  @@ -92,9 +89,6 @@
   {
       ap_status_t rv;
   
  -    if (thedir == NULL)
  -        return APR_EBADARG;
  -
       if ((rv = dir_cleanup(thedir)) == APR_SUCCESS) {
           ap_kill_cleanup(thedir->cntxt, thedir, dir_cleanup);
           return APR_SUCCESS;
  @@ -109,9 +103,6 @@
       ap_status_t ret;
   #endif
   
  -    if (thedir == NULL)
  -        return APR_EBADARG;
  -
   #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
       && !defined(READDIR_IS_THREAD_SAFE)
   
  @@ -136,9 +127,6 @@
   
   ap_status_t ap_rewinddir(ap_dir_t *thedir)
   {
  -    if (thedir == NULL)
  -        return APR_EBADARG;
  -
       rewinddir(thedir->dirstruct);
       return APR_SUCCESS;
   }
  @@ -170,9 +158,6 @@
       struct stat filestat;
       char *fname = NULL;    
   
  -    if (size == NULL || thedir == NULL)
  -        return APR_EBADARG;
  -
       if (thedir->entry == NULL) {
           *size = -1;
           return APR_ENOFILE;
  @@ -193,9 +178,6 @@
       struct stat filestat;
       char *fname = NULL;
   
  -    if (mtime == NULL || thedir == NULL)
  -        return APR_EBADARG;
  -
       if (thedir->entry == NULL) {
           *mtime = -1;
           return APR_ENOFILE;
  @@ -217,9 +199,6 @@
       struct stat filestat;
       char *fname = NULL;
   
  -    if (type == NULL || thedir == NULL)
  -        return APR_EBADARG;
  -
       if (thedir->entry == NULL) {
           *type = APR_REG;
           return APR_ENOFILE;
  @@ -253,9 +232,6 @@
   
   ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir)
   {
  -    if (new == NULL)
  -        return APR_EBADARG;
  -
       /* Detect End-Of-File */
       if (thedir == NULL || thedir->entry == NULL) {
           *new = NULL;
  
  
  
  1.24      +0 -9      apache-2.0/src/lib/apr/file_io/unix/fileacc.c
  
  Index: fileacc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/fileacc.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- fileacc.c	2000/04/14 00:58:37	1.23
  +++ fileacc.c	2000/04/21 14:51:22	1.24
  @@ -58,9 +58,6 @@
   
   ap_status_t ap_get_filename(char **new, ap_file_t *thefile)
   {
  -    if(new == NULL)
  -        return APR_EBADARG;
  -
       if (thefile != NULL) {
           *new = ap_pstrdup(thefile->cntxt, thefile->fname);
           return APR_SUCCESS;
  @@ -101,9 +98,6 @@
   
   ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file)
   {    
  -    if(data == NULL || key == NULL)
  -        return APR_EBADARG;
  -
       if (file != NULL) {
           return ap_get_userdata(data, key, file->cntxt);
       }
  @@ -116,9 +110,6 @@
   ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key,
                               ap_status_t (*cleanup) (void *))
   {    
  -    if(data == NULL || key == NULL)
  -        return APR_EBADARG;
  -
       if (file != NULL) {
           return ap_set_userdata(data, key, cleanup, file->cntxt);
       }
  
  
  
  1.21      +0 -3      apache-2.0/src/lib/apr/file_io/unix/filedup.c
  
  Index: filedup.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/filedup.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- filedup.c	2000/04/17 19:57:27	1.20
  +++ filedup.c	2000/04/21 14:51:22	1.21
  @@ -59,9 +59,6 @@
   {
       int have_file = 0;
   
  -    if (new_file == NULL || old_file == NULL)
  -        return APR_EBADARG;
  -
       if ((*new_file) == NULL) {
           (*new_file) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t));
           if ((*new_file) == NULL) {
  
  
  
  1.25      +0 -6      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- filestat.c	2000/04/14 15:58:22	1.24
  +++ filestat.c	2000/04/21 14:51:22	1.25
  @@ -84,9 +84,6 @@
   {
       struct stat info;
   
  -    if (finfo == NULL || thefile == NULL)
  -        return APR_EBADARG;
  -
       if (fstat(thefile->filedes, &info) == 0) {
           finfo->protection = info.st_mode;
           finfo->filetype = filetype_from_mode(info.st_mode);
  @@ -107,9 +104,6 @@
   ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont)
   {
       struct stat info;
  -
  -    if(finfo == NULL || fname == NULL)
  -        return APR_EBADARG;
   
       if (stat(fname, &info) == 0) {
           finfo->protection = info.st_mode;
  
  
  
  1.49      +1 -22     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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- open.c	2000/04/15 14:08:53	1.48
  +++ open.c	2000/04/21 14:51:22	1.49
  @@ -80,9 +80,6 @@
   {
       int oflags = 0;
   
  -    if (new == NULL)
  -        return APR_EBADARG;
  -
       if ((*new) == NULL) {
           (*new) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t));
       }
  @@ -162,9 +159,6 @@
   {
       ap_status_t rv;
     
  -    if (file == NULL)
  -        return APR_EBADARG;
  -
       if ((rv = ap_unix_file_cleanup(file)) == APR_SUCCESS) {
           ap_kill_cleanup(file->cntxt, file, ap_unix_file_cleanup);
           return APR_SUCCESS;
  @@ -184,9 +178,6 @@
   
   ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file)
   {
  -    if (thefile == NULL)
  -        return APR_EBADARG;
  -
       if (file == NULL) {
           return APR_ENOFILE;
       }
  @@ -200,9 +191,6 @@
   {
       int *dafile = thefile;
       
  -    if (file == NULL || thefile == NULL)
  -        return APR_EBADARG;
  -
       if ((*file) == NULL) {
           (*file) = ap_pcalloc(cont, sizeof(ap_file_t));
           (*file)->cntxt = cont;
  @@ -220,9 +208,6 @@
   
   ap_status_t ap_eof(ap_file_t *fptr)
   {
  -    if (fptr == NULL)
  -        return APR_EBADARG;
  -
       if (fptr->eof_hit == 1) {
           return APR_EOF;
       }
  @@ -231,20 +216,14 @@
   
   ap_status_t ap_ferror(ap_file_t *fptr)
   {
  -/* Thist function should be removed ASAP.  It is next on my list once
  +/* This function should be removed ASAP.  It is next on my list once
    * I am sure nobody is using it.
    */
  -    if (fptr == NULL)
  -        return APR_EBADARG;
  -
       return APR_SUCCESS;
   }   
   
   ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont)
   {
  -    if (thefile == NULL)
  -        return APR_EBADARG;
  -
       (*thefile) = ap_pcalloc(cont, sizeof(ap_file_t));
       if ((*thefile) == NULL) {
           return APR_ENOMEM;
  
  
  
  1.28      +0 -9      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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- pipe.c	2000/04/15 02:56:48	1.27
  +++ pipe.c	2000/04/21 14:51:22	1.28
  @@ -78,9 +78,6 @@
   
   ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout)
   {
  -    if(thepipe == NULL)
  -        return APR_EBADARG;
  -
       if (thepipe->pipe == 1) {
           thepipe->timeout = timeout;
           return APR_SUCCESS;
  @@ -92,9 +89,6 @@
   {
       int filedes[2];
   
  -    if(in == NULL || out == NULL)
  -        return APR_EBADARG;
  -
       if (pipe(filedes) == -1) {
           return errno;
       }
  @@ -136,9 +130,6 @@
   {
   #ifndef BEOS /* this code won't work on BeOS */
       int fd_flags;
  -
  -    if(thepipe == NULL)
  -        return APR_EBADARG;
   
       fd_flags = fcntl(thepipe->filedes, F_GETFL, 0);
   #if defined(O_NONBLOCK)
  
  
  
  1.44      +0 -30     apache-2.0/src/lib/apr/file_io/unix/readwrite.c
  
  Index: readwrite.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- readwrite.c	2000/04/15 03:02:59	1.43
  +++ readwrite.c	2000/04/21 14:51:23	1.44
  @@ -95,9 +95,6 @@
       ap_ssize_t rv;
       ap_ssize_t bytes_read;
   
  -    if(thefile == NULL || nbytes == NULL || (buf == NULL && *nbytes != 0))
  -        return APR_EBADARG;
  -
       if(*nbytes <= 0) {
           *nbytes = 0;
   	return APR_SUCCESS;
  @@ -192,9 +189,6 @@
   {
       ap_size_t rv;
   
  -    if(thefile == NULL || nbytes == NULL || (buf == NULL && *nbytes != 0))
  -        return APR_EBADARG;
  -
       if (thefile->buffered) {
           char *pos = (char *)buf;
           int blocksize;
  @@ -267,9 +261,6 @@
   #ifdef HAVE_WRITEV
       int bytes;
   
  -    if(thefile == NULL || vec == NULL || nvec < 0 || nbytes == NULL)
  -        return APR_EBADARG;
  -
       if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
           *nbytes = 0;
           return errno;
  @@ -286,9 +277,6 @@
   
   ap_status_t ap_putc(char ch, ap_file_t *thefile)
   {
  -    if(thefile == NULL)
  -        return APR_EBADARG;
  -
       if (write(thefile->filedes, &ch, 1) != 1) {
           return errno;
       }
  @@ -297,9 +285,6 @@
   
   ap_status_t ap_ungetc(char ch, ap_file_t *thefile)
   {
  -    if(thefile == NULL)
  -        return APR_EBADARG;
  -
       thefile->ungetchar = (unsigned char)ch;
       return APR_SUCCESS; 
   }
  @@ -308,9 +293,6 @@
   {
       ssize_t rv;
       
  -    if(thefile == NULL || ch == NULL)
  -        return APR_EBADARG;
  -
       if (thefile->ungetchar != -1) {
           *ch = (char) thefile->ungetchar;
           thefile->ungetchar = -1;
  @@ -332,9 +314,6 @@
       ssize_t rv;
       int len;
   
  -    if(thefile == NULL || str == NULL)
  -        return APR_EBADARG;
  -
       len = strlen(str);
       rv = write(thefile->filedes, str, len); 
       if (rv != len) {
  @@ -345,9 +324,6 @@
   
   ap_status_t ap_flush(ap_file_t *thefile)
   {
  -    if(thefile == NULL)
  -        return APR_EBADARG;
  -
       if (thefile->buffered) {
           ap_int64_t written = 0;
           int rc = 0;
  @@ -373,9 +349,6 @@
       ssize_t rv;
       int i, used_unget = FALSE, beg_idx;
   
  -    if(thefile == NULL || str == NULL || len < 0)
  -        return APR_EBADARG;
  -
       if(len <= 1)  /* as per fgets() */
           return APR_SUCCESS;
   
  @@ -426,9 +399,6 @@
       va_list ap;
       char *buf;
       int len;
  -
  -    if(fptr == NULL || format == NULL)
  -        return APR_EBADARG;
   
       buf = malloc(HUGE_STRING_LEN);
       if (buf == NULL) {
  
  
  
  1.28      +0 -1      apache-2.0/src/lib/apr/include/apr_errno.h
  
  Index: apr_errno.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_errno.h,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- apr_errno.h	2000/04/19 22:58:15	1.27
  +++ apr_errno.h	2000/04/21 14:51:25	1.28
  @@ -105,7 +105,6 @@
   /* empty slot: +17 */
   /* empty slot: +18 */
   #define APR_EDSOOPEN       (APR_OS_START_ERROR + 19)
  -#define APR_EBADARG        (APR_OS_START_ERROR + 20)
   
   /* APR STATUS VALUES */
   #define APR_INCHILD        (APR_OS_START_STATUS + 1)
  
  
  
  1.6       +0 -2      apache-2.0/src/lib/apr/misc/unix/errorcodes.c
  
  Index: errorcodes.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/errorcodes.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- errorcodes.c	2000/04/20 22:51:52	1.5
  +++ errorcodes.c	2000/04/21 14:51:26	1.6
  @@ -126,8 +126,6 @@
           return "This function has not been implemented on this platform";
       case APR_EMISMATCH:
           return "passwords do not match";
  -/* EBADARG needs to be removed soon.  */
  -    case APR_EBADARG:
       default:
           return "Error string not specified yet";
       }
  
  
  

Mime
View raw message