httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/threadproc/win32 thread.c threadpriv.c
Date Sat, 08 Jul 2000 11:31:50 GMT
gstein      00/07/08 04:31:50

  Modified:    src/lib/apr/file_io/unix fileacc.c
               src/lib/apr/locks/beos locks.c
               src/lib/apr/locks/unix locks.c
               src/lib/apr/locks/win32 locks.c
               src/lib/apr/misc/unix start.c
               src/lib/apr/network_io/beos poll.c sockets.c
               src/lib/apr/network_io/os2 sockets.c
               src/lib/apr/network_io/unix poll.c
               src/lib/apr/network_io/win32 poll.c
               src/lib/apr/threadproc/unix thread.c threadpriv.c
               src/lib/apr/threadproc/win32 thread.c threadpriv.c
  Log:
  a while back, we said "segfault on invalid params rather than returning an
  error." this removes some of the error checking that was occurring in the
  "user data" functions. also saw some in the "get/set OS type" functions and
  nuked those; there are still checks for pool==NULL, though, since that would
  end up making us malloc() rather than segfault'ing.
  
  Revision  Changes    Path
  1.31      +5 -22     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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- fileacc.c	2000/07/08 11:15:48	1.30
  +++ fileacc.c	2000/07/08 11:31:46	1.31
  @@ -69,16 +69,10 @@
   #endif
   /* A file to put ALL of the accessor functions for ap_file_t types. */
   
  -ap_status_t ap_get_filename(char **new, ap_file_t *thefile)
  +ap_status_t ap_get_filename(char **fname, ap_file_t *thefile)
   {
  -    if (thefile != NULL) {
  -        *new = ap_pstrdup(thefile->cntxt, thefile->fname);
  -        return APR_SUCCESS;
  -    }
  -    else {
  -        *new = NULL;
  -        return APR_ENOFILE;
  -    }
  +    *fname = ap_pstrdup(thefile->cntxt, thefile->fname);
  +    return APR_SUCCESS;
   }
   
   #if !defined(OS2) && !defined(WIN32)
  @@ -141,22 +135,11 @@
   
   ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file)
   {    
  -    if (file != NULL) {
  -        return ap_get_userdata(data, key, file->cntxt);
  -    }
  -    else {
  -        *data = NULL;
  -        return APR_ENOFILE;
  -    }
  +    return ap_get_userdata(data, key, file->cntxt);
   }
   
   ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key,
                               ap_status_t (*cleanup) (void *))
   {    
  -    if (file != NULL) {
  -        return ap_set_userdata(data, key, cleanup, file->cntxt);
  -    }
  -    else {
  -        return APR_ENOFILE;
  -    }
  +    return ap_set_userdata(data, key, cleanup, file->cntxt);
   }
  
  
  
  1.18      +2 -14     apache-2.0/src/lib/apr/locks/beos/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/beos/locks.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- locks.c	2000/07/08 11:15:50	1.17
  +++ locks.c	2000/07/08 11:31:46	1.18
  @@ -148,24 +148,12 @@
   
   ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data)
   {
  -    if (lock != NULL) {
  -        return ap_get_userdata(data, key, lock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOLOCK;
  -    }
  +    return ap_get_userdata(data, key, lock->cntxt);
   }
   
   ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key,
                               ap_status_t (*cleanup) (void *))
   {
  -    if (lock != NULL) {
  -        return ap_set_userdata(data, key, cleanup, lock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOLOCK;
  -    }
  +    return ap_set_userdata(data, key, cleanup, lock->cntxt);
   }
   
  
  
  
  1.36      +2 -17     apache-2.0/src/lib/apr/locks/unix/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- locks.c	2000/07/08 11:15:50	1.35
  +++ locks.c	2000/07/08 11:31:46	1.36
  @@ -169,32 +169,17 @@
   
   ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data)
   {
  -    if (lock != NULL) {
  -        return ap_get_userdata(data, key, lock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOLOCK;
  -    }
  +    return ap_get_userdata(data, key, lock->cntxt);
   }
   
   ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key,
                               ap_status_t (*cleanup) (void *))
   {
  -    if (lock != NULL) {
  -        return ap_set_userdata(data, key, cleanup, lock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOLOCK;
  -    }
  +    return ap_set_userdata(data, key, cleanup, lock->cntxt);
   }
   
   ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock)
   {
  -    if (lock == NULL) {
  -        return APR_ENOLOCK;
  -    }
       oslock->crossproc = lock->interproc;
   #if APR_HAS_THREADS
   #if APR_USE_PTHREAD_SERIALIZE
  
  
  
  1.27      +3 -17     apache-2.0/src/lib/apr/locks/win32/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/win32/locks.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- locks.c	2000/07/08 11:15:50	1.26
  +++ locks.c	2000/07/08 11:31:47	1.27
  @@ -156,32 +156,18 @@
   
   ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data)
   {
  -    if (lock != NULL) {
  -        return ap_get_userdata(data, key, lock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOLOCK;
  -    }
  +    return ap_get_userdata(data, key, lock->cntxt);
   }
   
   ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key,
                               ap_status_t (*cleanup) (void *))
   {
  -    if (lock != NULL) {
  -        return ap_set_userdata(data, key, cleanup, lock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOLOCK;
  -    }
  +    return ap_set_userdata(data, key, cleanup, lock->cntxt);
   }
   
   ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, ap_lock_t *lock)
   {
  -    if (lock == NULL) {
  -        return APR_ENOFILE;
  -    }
  +    /* ### this is broken. is the signature broken? */
       thelock = &(lock->mutex);
       return APR_SUCCESS;
   }
  
  
  
  1.35      +46 -52    apache-2.0/src/lib/apr/misc/unix/start.c
  
  Index: start.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/start.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- start.c	2000/07/08 11:15:51	1.34
  +++ start.c	2000/07/08 11:31:47	1.35
  @@ -57,23 +57,23 @@
   
   ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont)
   {
  -    ap_pool_t *new;
  +    ap_pool_t *newpool;
   
       if (cont) {
  -        new = ap_make_sub_pool(cont, cont->apr_abort);
  +        newpool = ap_make_sub_pool(cont, cont->apr_abort);
       }
       else {
  -        new = ap_make_sub_pool(NULL, NULL);
  +        newpool = ap_make_sub_pool(NULL, NULL);
       }
           
  -    if (new == NULL) {
  +    if (newpool == NULL) {
           return APR_ENOPOOL;
       }   
   
  -    new->prog_data = NULL;
  -    new->apr_abort = NULL;
  +    newpool->prog_data = NULL;
  +    newpool->apr_abort = NULL;
    
  -    *newcont = new;
  +    *newcont = newpool;
       return APR_SUCCESS;
   }
   
  @@ -82,53 +82,53 @@
                               ap_pool_t *cont)
   {
       datastruct *dptr = NULL, *dptr2 = NULL;
  -    if (cont) { 
  -        dptr = cont->prog_data;
  -        while (dptr) {
  -            if (!strcmp(dptr->key, key))
  -                break;
  -            dptr2 = dptr;
  -            dptr = dptr->next;
  +
  +    /* ### replace with an ap_hash_t */
  +
  +    dptr = cont->prog_data;
  +    while (dptr) {
  +        if (!strcmp(dptr->key, key))
  +            break;
  +        dptr2 = dptr;
  +        dptr = dptr->next;
  +    }
  +    if (dptr == NULL) {
  +        dptr = ap_pcalloc(cont, sizeof(datastruct));
  +        dptr->next = dptr->prev = NULL;
  +        dptr->key = ap_pstrdup(cont, key);
  +        if (dptr2) {
  +            dptr2->next = dptr;
  +            dptr->prev = dptr2;
           }
  -        if (dptr == NULL) {
  -            dptr = ap_pcalloc(cont, sizeof(datastruct));
  -            dptr->next = dptr->prev = NULL;
  -            dptr->key = ap_pstrdup(cont, key);
  -            if (dptr2) {
  -                dptr2->next = dptr;
  -                dptr->prev = dptr2;
  -            }
  -            else {
  -                cont->prog_data = dptr;
  -            }
  +        else {
  +            cont->prog_data = dptr;
           }
  -        dptr->data = data;
  -        ap_register_cleanup(cont, dptr->data, cleanup, cleanup);
  -        return APR_SUCCESS;
       }
  -    return APR_ENOPOOL;
  +    dptr->data = data;
  +    ap_register_cleanup(cont, dptr->data, cleanup, cleanup);
  +    return APR_SUCCESS;
   }
   
   ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont)
   {
       datastruct *dptr = NULL;
  -    if (cont) { 
  -        dptr = cont->prog_data;
  -        while (dptr) {
  -            if (!strcmp(dptr->key, key)) {
  -                break;
  -            }
  -            dptr = dptr->next;
  -        }
  -        if (dptr) {
  -            (*data) = dptr->data;
  -        }
  -        else {
  -            (*data) = NULL;
  +
  +    /* ### replace with an ap_hash_t */
  +
  +    dptr = cont->prog_data;
  +    while (dptr) {
  +        if (!strcmp(dptr->key, key)) {
  +            break;
           }
  -        return APR_SUCCESS;
  +        dptr = dptr->next;
  +    }
  +    if (dptr) {
  +        (*data) = dptr->data;
       }
  -    return APR_ENOPOOL;
  +    else {
  +        (*data) = NULL;
  +    }
  +    return APR_SUCCESS;
   }
   
   ap_status_t ap_initialize(void)
  @@ -163,12 +163,6 @@
   
   ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont)
   {
  -    if (cont == NULL) {
  -        return APR_ENOPOOL;
  -    }
  -    else {
  -        cont->apr_abort = apr_abort;
  -        return APR_SUCCESS;
  -    }
  +    cont->apr_abort = apr_abort;
  +    return APR_SUCCESS;
   }
  - 
  
  
  
  1.20      +3 -15     apache-2.0/src/lib/apr/network_io/beos/poll.c
  
  Index: poll.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/poll.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- poll.c	2000/07/08 11:15:51	1.19
  +++ poll.c	2000/07/08 11:31:47	1.20
  @@ -200,25 +200,13 @@
   
   ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data)
   {
  -    if (pollfd != NULL) {
  -        return ap_get_userdata(data, key, pollfd->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOFILE;
  -    }
  +    return ap_get_userdata(data, key, pollfd->cntxt);
   }
   
   ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key,
                               ap_status_t (*cleanup) (void *))
   {
  -    if (pollfd != NULL) {
  -        return ap_set_userdata(data, key, cleanup, pollfd->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOFILE;
  -    }
  +    return ap_set_userdata(data, key, cleanup, pollfd->cntxt);
   }
  -#endif
   
  +#endif /* BEOS_BONE */
  
  
  
  1.31      +3 -18     apache-2.0/src/lib/apr/network_io/beos/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/sockets.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- sockets.c	2000/07/08 11:15:51	1.30
  +++ sockets.c	2000/07/08 11:31:47	1.31
  @@ -192,32 +192,17 @@
   
   ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock)
   {
  -    if (socket != NULL) {
  -        return ap_get_userdata(data, key, sock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOSOCKET;
  -    }
  +    return ap_get_userdata(data, key, sock->cntxt);
   }
   
   ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key,
                                 ap_status_t (*cleanup) (void *))
   {
  -    if (sock != NULL) {
  -        return ap_set_userdata(data, key, cleanup, sock->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOSOCKET;
  -    }
  +    return ap_set_userdata(data, key, cleanup, sock->cntxt);
   }
   
   ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock)
   {
  -    if (sock == NULL) {
  -        return APR_ENOSOCKET;
  -    }
       *thesock = sock->socketdes;
       return APR_SUCCESS;
   }
  @@ -235,4 +220,4 @@
       (*sock)->socketdes = *thesock;
       return APR_SUCCESS;
   }
  -#endif
  +#endif /* BEOS_BONE */
  
  
  
  1.24      +2 -17     apache-2.0/src/lib/apr/network_io/os2/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/os2/sockets.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- sockets.c	2000/07/08 11:15:51	1.23
  +++ sockets.c	2000/07/08 11:31:48	1.24
  @@ -209,13 +209,7 @@
   ap_status_t ap_get_socketdata(void **data, const char *key,
                                 ap_socket_t *socket)
   {
  -    if (socket != NULL) {
  -        return ap_get_userdata(data, key, socket->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOSOCKET;
  -    }
  +    return ap_get_userdata(data, key, socket->cntxt);
   }
   
   
  @@ -223,20 +217,11 @@
   ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key,
                                 ap_status_t (*cleanup) (void *))
   {
  -    if (socket != NULL) {
  -        return ap_set_userdata(data, key, cleanup, socket->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOSOCKET;
  -    }
  +    return ap_set_userdata(data, key, cleanup, socket->cntxt);
   }
   
   ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock)
   {
  -    if (sock == NULL) {
  -        return APR_ENOSOCKET;
  -    }
       *thesock = sock->socketdes;
       return APR_SUCCESS;
   }
  
  
  
  1.36      +2 -14     apache-2.0/src/lib/apr/network_io/unix/poll.c
  
  Index: poll.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/poll.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- poll.c	2000/07/08 11:15:52	1.35
  +++ poll.c	2000/07/08 11:31:48	1.36
  @@ -359,25 +359,13 @@
   
   ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data)
   {
  -    if (pollfd != NULL) {
  -        return ap_get_userdata(data, key, pollfd->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOFILE;
  -    }
  +    return ap_get_userdata(data, key, pollfd->cntxt);
   }
   
   ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key,
                               ap_status_t (*cleanup) (void *))
   {
  -    if (pollfd != NULL) {
  -        return ap_set_userdata(data, key, cleanup, pollfd->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOFILE;
  -    }
  +    return ap_set_userdata(data, key, cleanup, pollfd->cntxt);
   }
   
   #if APR_FILES_AS_SOCKETS
  
  
  
  1.18      +2 -14     apache-2.0/src/lib/apr/network_io/win32/poll.c
  
  Index: poll.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/poll.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- poll.c	2000/07/08 11:15:52	1.17
  +++ poll.c	2000/07/08 11:31:49	1.18
  @@ -195,25 +195,13 @@
   
   ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data)
   {
  -    if (pollfd != NULL) {
  -        return ap_get_userdata(data, key, pollfd->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOFILE;
  -    }
  +    return ap_get_userdata(data, key, pollfd->cntxt);
   }
   
   ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key,
                               ap_status_t (*cleanup) (void *))
   {
  -    if (pollfd != NULL) {
  -        return ap_set_userdata(data, key, cleanup, pollfd->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOFILE;
  -    }
  +    return ap_set_userdata(data, key, cleanup, pollfd->cntxt);
   }
   
   ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, 
  
  
  
  1.26      +3 -17     apache-2.0/src/lib/apr/threadproc/unix/thread.c
  
  Index: thread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/thread.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- thread.c	2000/07/08 11:15:53	1.25
  +++ thread.c	2000/07/08 11:31:49	1.26
  @@ -186,33 +186,19 @@
   
   ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread)
   {
  -    if (thread != NULL) {
  -        return ap_get_userdata(data, key, thread->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHREAD;
  -    }
  +    return ap_get_userdata(data, key, thread->cntxt);
   }
   
   ap_status_t ap_set_threaddata(void *data, const char *key,
                                 ap_status_t (*cleanup) (void *),
                                 ap_thread_t *thread)
   {
  -    if (thread != NULL) {
  -        return ap_set_userdata(data, key, cleanup, thread->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHREAD;
  -    }
  +    return ap_set_userdata(data, key, cleanup, thread->cntxt);
   }
   
   ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd)
   {
  -    if (thd == NULL) {
  -        return APR_ENOTHREAD;
  -    }
  +    /* ### broken. is the signature broken? */
       thethd = thd->td;
       return APR_SUCCESS;
   }
  
  
  
  1.23      +5 -19     apache-2.0/src/lib/apr/threadproc/unix/threadpriv.c
  
  Index: threadpriv.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/threadpriv.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- threadpriv.c	2000/07/08 11:15:53	1.22
  +++ threadpriv.c	2000/07/08 11:31:49	1.23
  @@ -111,33 +111,19 @@
   ap_status_t ap_get_threadkeydata(void **data, const char *key,
                                    ap_threadkey_t *threadkey)
   {
  -    if (threadkey != NULL) {
  -        return ap_get_userdata(data, key, threadkey->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHDKEY;
  -    }
  +    return ap_get_userdata(data, key, threadkey->cntxt);
   }
   
   ap_status_t ap_set_threadkeydata(void *data, const char *key,
                                    ap_status_t (*cleanup) (void *),
                                    ap_threadkey_t *threadkey)
   {
  -    if (threadkey != NULL) {
  -        return ap_set_userdata(data, key, cleanup, threadkey->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHDKEY;
  -    }
  +    return ap_set_userdata(data, key, cleanup, threadkey->cntxt);
   }
   
   ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key)
   {
  -    if (key == NULL) {
  -        return APR_ENOFILE;
  -    }
  +    /* ### broken. is the signature broken? */
       thekey = &(key->key);
       return APR_SUCCESS;
   }
  @@ -155,5 +141,5 @@
       (*key)->key = *thekey;
       return APR_SUCCESS;
   }           
  -#endif
  -#endif
  +#endif /* APR_HAVE_PTHREAD_H */
  +#endif /* APR_HAS_THREADS */
  
  
  
  1.21      +3 -14     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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- thread.c	2000/07/08 11:15:53	1.20
  +++ thread.c	2000/07/08 11:31:49	1.21
  @@ -158,26 +158,14 @@
   
   ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread)
   {
  -    if (thread != NULL) {
  -        return ap_get_userdata(data, key, thread->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHREAD;
  -    }
  +    return ap_get_userdata(data, key, thread->cntxt);
   }
   
   ap_status_t ap_set_threaddata(void *data, const char *key,
                                 ap_status_t (*cleanup) (void *),
                                 ap_thread_t *thread)
   {
  -    if (thread != NULL) {
  -        return ap_set_userdata(data, key, cleanup, thread->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHREAD;
  -    }
  +    return ap_set_userdata(data, key, cleanup, thread->cntxt);
   }
   
   ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd)
  @@ -185,6 +173,7 @@
       if (thd == NULL) {
           return APR_ENOTHREAD;
       }
  +    /* ### this is broken. is the signature broken? */
       thethd = thd->td;
       return APR_SUCCESS;
   }
  
  
  
  1.17      +3 -17     apache-2.0/src/lib/apr/threadproc/win32/threadpriv.c
  
  Index: threadpriv.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/win32/threadpriv.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- threadpriv.c	2000/07/08 11:15:53	1.16
  +++ threadpriv.c	2000/07/08 11:31:49	1.17
  @@ -95,33 +95,19 @@
   ap_status_t ap_get_threadkeydata(void **data, const char *key,
                                    ap_threadkey_t *threadkey)
   {
  -    if (threadkey != NULL) {
  -        return ap_get_userdata(data, key, threadkey->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHDKEY;
  -    }
  +    return ap_get_userdata(data, key, threadkey->cntxt);
   }
   
   ap_status_t ap_set_threadkeydata(void *data, const char *key,
                                    ap_status_t (*cleanup) (void *), 
                                    ap_threadkey_t *threadkey)
   {
  -    if (threadkey != NULL) {
  -        return ap_set_userdata(data, key, cleanup, threadkey->cntxt);
  -    }
  -    else {
  -        data = NULL;
  -        return APR_ENOTHDKEY;
  -    }
  +    return ap_set_userdata(data, key, cleanup, threadkey->cntxt);
   }
   
   ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key)
   {
  -    if (key == NULL) {
  -        return APR_ENOFILE;
  -    }
  +    /* ### this is broken. dunno if the signature is broken... */
       thekey = &(key->key);
       return APR_SUCCESS;
   }
  
  
  

Mime
View raw message