Commit 11ad3b35 authored by Robert Haas's avatar Robert Haas

Remove unnecessary cleanup code.

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.
parent 06db9cce
...@@ -554,14 +554,6 @@ dsm_impl_sysv(dsm_op op, dsm_handle handle, Size request_size, ...@@ -554,14 +554,6 @@ dsm_impl_sysv(dsm_op op, dsm_handle handle, Size request_size,
if (shmctl(ident, IPC_STAT, &shm) != 0) 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, ereport(elevel,
(errcode_for_dynamic_shared_memory(), (errcode_for_dynamic_shared_memory(),
errmsg("could not stat shared memory segment \"%s\": %m", errmsg("could not stat shared memory segment \"%s\": %m",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment