Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 22735 invoked by uid 500); 30 Aug 2001 15:54:10 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 22717 invoked from network); 30 Aug 2001 15:54:10 -0000 Date: 30 Aug 2001 15:53:06 -0000 Message-ID: <20010830155306.90356.qmail@icarus.apache.org> From: trawick@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/shmem/unix shmem.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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,