You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2001/02/20 21:08:21 UTC

cvs commit: apr/shmem/unix shmem.c

trawick     01/02/20 12:08:20

  Modified:    .        CHANGES
               shmem/unix shmem.c
  Log:
  In apr_shm_init(), check the retcode from mm_malloc().  Previously,
  we segfaulted here if mm_malloc() failed to get a lock.  An example
  error scenario is when the lock file lives on a filesystem which
  doesn't support locking.
  
  Revision  Changes    Path
  1.66      +5 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- CHANGES	2001/02/20 01:53:46	1.65
  +++ CHANGES	2001/02/20 20:08:13	1.66
  @@ -1,5 +1,10 @@
   Changes with APR b1  
   
  +  *) In apr_shm_init(), check the retcode from mm_malloc().  Previously,
  +     we segfaulted here if mm_malloc() failed to get a lock.  An example
  +     error scenario is when the lock file lives on a filesystem which
  +     doesn't support locking.  [Jeff Trawick]
  +
     *) Name protected the autoconf macros defined by APR.  Moved the
        REENTRANCY_FLAGS settings into apr_hints.m4. Inlined the
        APR_PREPARE_MM_DIR macro because it could only be used once.
  
  
  
  1.21      +6 -0      apr/shmem/unix/shmem.c
  
  Index: shmem.c
  ===================================================================
  RCS file: /home/cvs/apr/shmem/unix/shmem.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- shmem.c	2001/02/16 04:16:06	1.20
  +++ shmem.c	2001/02/20 20:08:17	1.21
  @@ -75,6 +75,12 @@
           return errno;
       }
       (*m) = mm_malloc(newmm, sizeof(struct shmem_t));
  +    /* important to check this; we may be locking a lock file for the first
  +     * time, which won't work if the file is on NFS
  +     */
  +    if (!*m) {
  +        return errno;
  +    }
       (*m)->mm = newmm;
   #if BEOS
       (*m)->id = area_for((*m));