httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/threadproc/unix signals.c
Date Wed, 05 Apr 2000 11:24:23 GMT
dreid       00/04/05 04:24:22

  Modified:    src/lib/apr/misc/beos Makefile.in misc.h misc_common.c
               src/lib/apr/misc/unix otherchild.c start.c
               src/lib/apr/test htdigest.c testmmap.c testoc.c
               src/lib/apr/threadproc/beos Makefile.in proc.c threadproc.h
               src/lib/apr/threadproc/unix signals.c
  Added:       src/lib/apr/threadproc/beos threadproc_common.c
  Removed:     src/lib/apr/threadproc/beos signals.c
  Log:
  Add more code sharing arrangements and a few minor updates/tweaks.
  
  Revision  Changes    Path
  1.9       +1 -1      apache-2.0/src/lib/apr/misc/beos/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/beos/Makefile.in,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Makefile.in	2000/04/04 22:56:11	1.8
  +++ Makefile.in	2000/04/05 11:24:17	1.9
  @@ -14,7 +14,7 @@
   
   LIB=libmisc.a
   
  -OBJS=start.o misc_common.o otherchild.o
  +OBJS=misc_common.o
   
   .c.o:
   	$(CC) $(CFLAGS) -c $(INCLUDES) $<
  
  
  
  1.11      +4 -1      apache-2.0/src/lib/apr/misc/beos/misc.h
  
  Index: misc.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/beos/misc.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- misc.h	2000/04/04 22:56:11	1.10
  +++ misc.h	2000/04/05 11:24:17	1.11
  @@ -90,7 +90,10 @@
   
   struct ap_other_child_rec_t {
       struct ap_other_child_rec_t *next;
  -    thread_id tid;
  +    thread_id pid; /* this is actually a thread_id, but in order to
  +                      restrict the amount of code duplication we'll use
  +                      pid so that the Unix code won't have too many #ifdef's
  +                   */
       void (*maintenance) (int, void *);
       void *data;
       int write_fd;
  
  
  
  1.3       +48 -23    apache-2.0/src/lib/apr/misc/beos/misc_common.c
  
  Index: misc_common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/beos/misc_common.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- misc_common.c	2000/03/16 13:59:05	1.2
  +++ misc_common.c	2000/04/05 11:24:17	1.3
  @@ -1,36 +1,61 @@
  -/*
  - * Copyright (c) 1987, 1993, 1994
  - *      The Regents of the University of California.  All rights reserved.
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
    *
  + * Copyright (c) 2000 The Apache Software Foundation.  All rights
  + * reserved.
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  + *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in the
  - *    documentation and/or other materials provided with the distribution.
  - * 3. All advertising materials mentioning features or use of this software
  - *    must display the following acknowledgement:
  - *      This product includes software developed by the University of
  - *      California, Berkeley and its contributors.
  - * 4. Neither the name of the University nor the names of its contributors
  - *    may be used to endorse or promote products derived from this software
  - *    without specific prior written permission.
  - *
  - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Apache" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact apache@apache.org.
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
    */
   
   /* BeOS uses identical code so let's not have 2 copies... */
   
  +#include "../unix/start.c"
  +
   #include "../unix/getopt.c"
  +
  +#include "../unix/otherchild.c"
  
  
  
  1.5       +6 -2      apache-2.0/src/lib/apr/misc/unix/otherchild.c
  
  Index: otherchild.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/otherchild.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- otherchild.c	2000/04/04 22:36:59	1.4
  +++ otherchild.c	2000/04/05 11:24:19	1.5
  @@ -53,7 +53,11 @@
    */
   
   #include "misc.h"
  +#ifndef BEOS
   #include "../../threadproc/unix/threadproc.h"
  +#else
  +#include "../../threadproc/beos/threadproc.h"
  +#endif
   
   static ap_other_child_rec_t *other_children = NULL;
   
  @@ -167,7 +171,7 @@
    *    maintenance function.
    * arg 1) The process to check.
    */
  -API_EXPORT(ap_status_t) reap_other_child(ap_proc_t *pid)
  +API_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid)
   {
       ap_other_child_rec_t *ocr, *nocr;
   
  @@ -175,6 +179,7 @@
           nocr = ocr->next;
           if (ocr->pid != pid->pid)
               continue;
  +
           ocr->pid = -1;
           (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data);
           return 0;
  @@ -212,4 +217,3 @@
           }
       }
   }
  -
  
  
  
  1.25      +6 -0      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- start.c	2000/04/03 19:44:56	1.24
  +++ start.c	2000/04/05 11:24:19	1.25
  @@ -53,7 +53,11 @@
    */
   
   #include "misc.h"
  +#ifndef BEOS
   #include "../../locks/unix/locks.h"
  +#else
  +#include "../../locks/beos/locks.h"
  +#endif
   
   /* ***APRDOC********************************************************
    * ap_status_t ap_create_context(ap_context_t **newcont, ap_context_t *cont)
  @@ -188,7 +192,9 @@
   ap_status_t ap_initialize(void)
   {
       ap_status_t status;
  +#ifndef BEOS
       setup_lock();
  +#endif
       status = ap_init_alloc();
       return status;
   }
  
  
  
  1.15      +12 -1     apache-2.0/src/lib/apr/test/htdigest.c
  
  Index: htdigest.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/htdigest.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- htdigest.c	2000/03/31 08:36:20	1.14
  +++ htdigest.c	2000/04/05 11:24:20	1.15
  @@ -66,9 +66,20 @@
   
   #include "apr_lib.h"
   #include "apr_md5.h"
  -#include <sys/types.h>
  +#include "apr_config.h"
  +
  +#ifdef HAVE_SYS_TYPES_H
  + #include <sys/types.h>
  +#endif
  +
  +#ifdef HAVE_SYS_SIGNAL_H
   #include <sys/signal.h>
  +#endif
  +
  +#ifdef HAVE_SIGNAL_H
   #include <signal.h>
  +#endif
  +
   #include <stdlib.h>
   
   #ifdef WIN32
  
  
  
  1.11      +1 -1      apache-2.0/src/lib/apr/test/testmmap.c
  
  Index: testmmap.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testmmap.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- testmmap.c	2000/04/03 02:39:27	1.10
  +++ testmmap.c	2000/04/05 11:24:20	1.11
  @@ -115,7 +115,7 @@
           fprintf(stdout, "%d bytes\n", (int)finfo.size);
       }  
       
  -    fprintf(stdout,"Trying to mmap the file..............");
  +    fprintf(stdout,"Trying to mmap the file.............");
       if (ap_mmap_create(&themmap, thefile, 0, finfo.size, context) != APR_SUCCESS) {
           fprintf(stderr,"Failed!\n");
           exit(-1);
  
  
  
  1.3       +1 -1      apache-2.0/src/lib/apr/test/testoc.c
  
  Index: testoc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testoc.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- testoc.c	2000/04/04 22:56:11	1.2
  +++ testoc.c	2000/04/05 11:24:20	1.3
  @@ -141,7 +141,7 @@
       sleep(1);
       
       fprintf(stdout, "[PARENT] Checking on children..........\n");
  -    check_other_child();
  +    ap_check_other_child();
       
       return 1;
   }    
  
  
  
  1.8       +1 -1      apache-2.0/src/lib/apr/threadproc/beos/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/beos/Makefile.in,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Makefile.in	2000/04/03 21:32:12	1.7
  +++ Makefile.in	2000/04/05 11:24:21	1.8
  @@ -18,7 +18,7 @@
   	thread.o \
   	threadcancel.o \
   	threadpriv.o \
  -	signals.o \
  +	threadproc_common.o \
           procsup.o \
           apr_proc_stub
   
  
  
  
  1.21      +5 -5      apache-2.0/src/lib/apr/threadproc/beos/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/beos/proc.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- proc.c	2000/04/03 19:45:17	1.20
  +++ proc.c	2000/04/05 11:24:21	1.21
  @@ -259,7 +259,7 @@
       }
   
       send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe));
  -    (*new)->tid = newproc;
  +    (*new)->pid = newproc;
   
       /* before we go charging on we need the new process to get to a 
        * certain point.  When it gets there it'll let us know and we
  @@ -299,14 +299,14 @@
       /* when we run processes we are actually running threads, so here
          we'll wait on the thread dying... */
       if (wait == APR_WAIT) {
  -        if (wait_for_thread(proc->tid, &exitval) == B_OK) {
  +        if (wait_for_thread(proc->pid, &exitval) == B_OK) {
               return APR_CHILD_DONE;
           }
           return errno;
       }
       /* if the thread is still alive then it's not done...
          this won't hang or holdup the thread checking... */
  -    if (get_thread_info(proc->tid, &tinfo) == B_BAD_VALUE) {
  +    if (get_thread_info(proc->pid, &tinfo) == B_BAD_VALUE) {
           return APR_CHILD_DONE;
       }
       /* if we get this far it's still going... */
  @@ -363,7 +363,7 @@
       if (proc == NULL) {
           return APR_ENOPROC;
       }
  -    *theproc = proc->tid;
  +    *theproc = proc->pid;
       return APR_SUCCESS;
   }
   
  @@ -377,7 +377,7 @@
           (*proc) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t));
           (*proc)->cntxt = cont;
       }
  -    (*proc)->tid = *theproc;
  +    (*proc)->pid = *theproc;
       return APR_SUCCESS;
   }              
   
  
  
  
  1.9       +1 -2      apache-2.0/src/lib/apr/threadproc/beos/threadproc.h
  
  Index: threadproc.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/beos/threadproc.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- threadproc.h	2000/04/03 18:37:44	1.8
  +++ threadproc.h	2000/04/05 11:24:21	1.9
  @@ -123,8 +123,7 @@
   
   struct ap_proc_t {
       ap_context_t *cntxt;
  -    pid_t pid;
  -    thread_id tid;
  +    thread_id pid;
       struct ap_procattr_t *attr;
   };
   
  
  
  
  1.1                  apache-2.0/src/lib/apr/threadproc/beos/threadproc_common.c
  
  Index: threadproc_common.c
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  /* As the signal code is identical, use the unix version to reduce
     code duplication */
     
  #include "../unix/signals.c"
  
  
  
  1.9       +4 -0      apache-2.0/src/lib/apr/threadproc/unix/signals.c
  
  Index: signals.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/signals.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- signals.c	2000/04/03 19:45:26	1.8
  +++ signals.c	2000/04/05 11:24:22	1.9
  @@ -52,7 +52,11 @@
    * <http://www.apache.org/>.
    */
   
  +#ifndef BEOS
   #include "threadproc.h"
  +#else
  +#include "../beos/threadproc.h"
  +#endif
   
   /* ***APRDOC********************************************************
    * ap_status_t ap_kill(ap_proc_t *proc, int sig)
  
  
  

Mime
View raw message