rbb         99/11/10 07:25:05

  Modified:    src/lib/apr/mmap/unix common.c mmap.c mmap_h.h
  Log:
  Fix a logic error for mmap on unix.  Basically, if you are going to check for
  the existance of an autoconf generated defintion, the check must be after
  you include all of your header files.  Also, you must include apr_config.h.
  Lastly, include statements for system headers should ALWAYS be wrappered
  but #ifdef's checking for the availability of those header files.
  
  Revision  Changes    Path
  1.3       +16 -11    apache-2.0/src/lib/apr/mmap/unix/common.c
  
  Index: common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/mmap/unix/common.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- common.c  1999/11/04 12:33:41     1.2
  +++ common.c  1999/11/10 15:25:04     1.3
  @@ -61,26 +61,31 @@
    * care of those.
    *
    */
  - 
  -#if HAVE_MMAP
   
  -#ifdef BEOS
  -#include "../beos/mmap_h.h"
  -#include <kernel/OS.h>
  -#else
  -#include "mmap_h.h"
  -#include <sys/mman.h>
  -#endif
  -
   #include "fileio.h"
   #include "apr_mmap.h"
   #include "apr_general.h"
   #include "apr_portable.h"
   #include "apr_lib.h"
  -#include <errno.h>
  +#include "apr_errno.h"
  +#ifdef HAVE_STRING_H
   #include <string.h>
  +#endif
  +#ifdef HAVE_STDIO_H
   #include <stdio.h>
  +#endif
   
  +#ifdef BEOS
  +#include "../beos/mmap_h.h"
  +#include <kernel/OS.h>
  +#else
  +#include "mmap_h.h"
  +#ifdef HAVE_SYS_MMAN_H
  +#include <sys/mman.h>
  +#endif
  +#endif
  +
  +#if HAVE_MMAP
   
   ap_int32_t ap_mmap_inode_compare(const void *m1, const void *m2)
   {
  
  
  
  1.6       +10 -3     apache-2.0/src/lib/apr/mmap/unix/mmap.c
  
  Index: mmap.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/mmap/unix/mmap.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mmap.c    1999/11/04 12:33:42     1.5
  +++ mmap.c    1999/11/10 15:25:04     1.6
  @@ -53,18 +53,25 @@
    *
    */
   
  -#if HAVE_MMAP
  -
   #include "mmap_h.h"
   #include "fileio.h"
   #include "apr_mmap.h"
   #include "apr_general.h"
   #include "apr_portable.h"
   #include "apr_lib.h"
  +#include "apr_errno.h"
  +#include "apr_config.h"
  +#ifdef HAVE_SYS_MMAN_H
   #include <sys/mman.h>
  -#include <errno.h>
  +#endif
  +#ifdef HAVE_STRING_H
   #include <string.h>
  +#endif
  +#ifdef HAVE_STDIO_H
   #include <stdio.h>
  +#endif
  +
  +#if HAVE_MMAP
   
   ap_status_t mmap_cleanup(void *themmap)
   {
  
  
  
  1.3       +3 -1      apache-2.0/src/lib/apr/mmap/unix/mmap_h.h
  
  Index: mmap_h.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/mmap/unix/mmap_h.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mmap_h.h  1999/11/04 12:33:42     1.2
  +++ mmap_h.h  1999/11/10 15:25:04     1.3
  @@ -56,10 +56,12 @@
   #ifndef MMAP_H_H
   #define MMAP_H_H
   
  -#include <sys/stat.h>
   #include "apr_general.h"
   #include "apr_mmap.h"
   #include "apr_errno.h"
  +#ifdef HAVE_SYS_STAT_H
  +#include <sys/stat.h>
  +#endif
   
   struct mmap_t {
       ap_context_t *cntxt;
  
  
  

Reply via email to