apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/shmem/unix shmem.c
Date Thu, 30 Aug 2001 15:53:06 GMT
trawick     01/08/30 08:53:06

  Modified:    shmem/unix shmem.c
  Log:
  fix some bad retcodes (adding APR_OS_START_SYSERR to errno) in the
  shared memory code for unix
  
  there are still some unexpected uses of APR_EGENERAL and a general
  lack of cleanup of previous steps when something goes wrong
  (not always a reasonable thing to do with shared memory)
  
  Revision  Changes    Path
  1.32      +4 -4      apr/shmem/unix/shmem.c
  
  Index: shmem.c
  ===================================================================
  RCS file: /home/cvs/apr/shmem/unix/shmem.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- shmem.c	2001/08/30 02:30:48	1.31
  +++ shmem.c	2001/08/30 15:53:06	1.32
  @@ -151,7 +151,7 @@
       /* FIXME: Is APR_OS_DEFAULT sufficient? */
       tmpfd = shm_open(filename, O_RDWR | O_CREAT, APR_OS_DEFAULT);
       if (tmpfd == -1)
  -        return errno + APR_OS_START_SYSERR;
  +        return errno;
   
       apr_os_file_put(&new_m->file, &tmpfd, pool); 
       status = apr_file_trunc(new_m->file, reqsize);
  @@ -175,7 +175,7 @@
   #elif APR_USE_SHMEM_SHMGET
       tmpfd = shmget(IPC_PRIVATE, reqsize, (SHM_R|SHM_W|IPC_CREAT));
       if (tmpfd == -1)
  -        return errno + APR_OS_START_SYSERR;
  +        return errno;
   
       new_m->file = tmpfd;
   
  @@ -183,14 +183,14 @@
   
       /* FIXME: Handle errors. */
       if (shmctl(new_m->file, IPC_STAT, &shmbuf) == -1)
  -        return errno + APR_OS_START_SYSERR;
  +        return errno;
   
       apr_current_userid(&uid, &gid, pool);
       shmbuf.shm_perm.uid = uid;
       shmbuf.shm_perm.gid = gid;
   
       if (shmctl(new_m->file, IPC_SET, &shmbuf) == -1)
  -        return errno + APR_OS_START_SYSERR;
  +        return errno;
   
   #elif APR_USE_SHMEM_BEOS
       new_m->area_id = create_area("mm", (void*)&mem, B_ANY_ADDRESS, reqsize, 
  
  
  

Mime
View raw message