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/05/16 19:04:12 UTC

cvs commit: apache-2.0/src/lib/apr/misc/unix getopt.c misc.h otherchild.c

rbb         00/05/16 10:04:12

  Modified:    src/lib/apr/misc/unix getopt.c misc.h otherchild.c
  Removed:     src/lib/apr/misc/beos Makefile.in misc.h misc_common.c
                        otherchild.c start.c
  Log:
  Remove the separate beos directory and add support to the unix directory
  for BeOS support.  The diffs are minimal, and this makes it much easier
  to find and fix bugs, without duplicating nearly as much code.
  
  Revision  Changes    Path
  1.10      +2 -4      apache-2.0/src/lib/apr/misc/unix/getopt.c
  
  Index: getopt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/getopt.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- getopt.c	2000/04/14 15:58:32	1.9
  +++ getopt.c	2000/05/16 17:04:09	1.10
  @@ -67,8 +67,7 @@
            * if the user didn't specify '-' as an option,
            * assume it means -1.
            */
  -        if (ap_optopt == (int) '-')
  -        {
  +        if (ap_optopt == (int) '-') {
               *rv = ap_optopt;
               return (APR_EOF);
           }
  @@ -95,8 +94,7 @@
               ap_optarg = place;
           else if (nargc <= ++ap_optind) {        /* no arg */
               place = EMSG;
  -            if (*ostr == ':')
  -            {
  +            if (*ostr == ':') {
                   *rv = ap_optopt;
                   return (APR_BADARG);
               }
  
  
  
  1.16      +4 -1      apache-2.0/src/lib/apr/misc/unix/misc.h
  
  Index: misc.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/misc.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- misc.h	2000/04/24 21:50:17	1.15
  +++ misc.h	2000/05/16 17:04:09	1.16
  @@ -77,6 +77,9 @@
   #ifdef HAVE_PTHREAD_H
   #include <pthread.h>
   #endif
  +#ifdef BEOS
  +#include <kernel/OS.h>
  +#endif
    
   typedef struct datastruct {
       void *data;
  @@ -87,7 +90,7 @@
   
   struct ap_other_child_rec_t {
       struct ap_other_child_rec_t *next;
  -    int pid;
  +    int id;  /* This is either a pid or tid depending on the platform */
       void (*maintenance) (int, void *, int);
       void *data;
       int write_fd;
  
  
  
  1.11      +8 -8      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- otherchild.c	2000/05/04 00:27:52	1.10
  +++ otherchild.c	2000/05/16 17:04:09	1.11
  @@ -74,7 +74,7 @@
       ap_other_child_rec_t *ocr;
   
       ocr = ap_palloc(p, sizeof(*ocr));
  -    ocr->pid = pid->pid;
  +    ocr->id = pid->pid;
       ocr->maintenance = maintenance;
       ocr->data = data;
       if (write_fd == NULL) {
  @@ -158,10 +158,10 @@
   
       for (ocr = other_children; ocr; ocr = nocr) {
           nocr = ocr->next;
  -        if (ocr->pid != pid->pid)
  +        if (ocr->id != pid->pid)
               continue;
   
  -        ocr->pid = -1;
  +        ocr->id = -1;
           (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status);
           return 0;
       }
  @@ -176,12 +176,12 @@
   
       for (ocr = other_children; ocr; ocr = nocr) {
           nocr = ocr->next;
  -        if (ocr->pid == -1)
  +        if (ocr->id == -1)
               continue;
   
  -        waitret = waitpid(ocr->pid, &status, WNOHANG);
  -        if (waitret == ocr->pid) {
  -            ocr->pid = -1;
  +        waitret = waitpid(ocr->id, &status, WNOHANG);
  +        if (waitret == ocr->id) {
  +            ocr->id = -1;
               (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status);
           }
           else if (waitret == 0) {
  @@ -189,7 +189,7 @@
           }
           else if (waitret == -1) {
               /* uh what the heck? they didn't call unregister? */
  -            ocr->pid = -1;
  +            ocr->id = -1;
               (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1);
           }
       }