]> granicus.if.org Git - postgresql/commitdiff
Remove unnecessary cleanup code.
authorRobert Haas <rhaas@postgresql.org>
Thu, 22 May 2014 14:40:00 +0000 (10:40 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 22 May 2014 14:41:48 +0000 (10:41 -0400)
This is all inside a block guarded by op == DSM_OP_ATTACH, so it can
never be the case that op == DSM_OP_CREATE.

Reported by Coverity.

src/backend/storage/ipc/dsm_impl.c

index 74dace999ef3217b139d60aaefe4c472f94685c7..0819641ad96c119c7b72ae0c065070c1c61b3d54 100644 (file)
@@ -554,14 +554,6 @@ dsm_impl_sysv(dsm_op op, dsm_handle handle, Size request_size,
 
                if (shmctl(ident, IPC_STAT, &shm) != 0)
                {
-                       int                     save_errno;
-
-                       /* Back out what's already been done. */
-                       save_errno = errno;
-                       if (op == DSM_OP_CREATE)
-                               shmctl(ident, IPC_RMID, NULL);
-                       errno = save_errno;
-
                        ereport(elevel,
                                        (errcode_for_dynamic_shared_memory(),
                                         errmsg("could not stat shared memory segment \"%s\": %m",