postgres.git / summary / log / commit / refs
commit 494f3cb5bbdae3d75b0100559a8a05020e8338ff
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue Apr 10 22:34:40 2018 +0000
First released in: 11.0, 9.4.18, 9.5.13, 9.6.9, 10.4
Fix incorrect close() call in dsm_impl_mmap().
One improbable error-exit path in this function used close() where
it should have used CloseTransientFile(). This is unlikely to be
hit in the field, and I think the consequences wouldn't be awful
(just an elog(LOG) bleat later). But a bug is a bug, so back-patch
to 9.4 where this code came in.
Pan Bian
Discussion: https://postgr.es/m/152056616579.4966.583293218357089052@wrigleys.postgresql.org
src/backend/storage/ipc/dsm_impl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c
index 1a11d21df0c..abfbadddc60 100644
--- a/src/backend/storage/ipc/dsm_impl.c
+++ b/src/backend/storage/ipc/dsm_impl.c
@@ -923,7 +923,7 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
/* Back out what's already been done. */
save_errno = errno;
- close(fd);
+ CloseTransientFile(fd);
if (op == DSM_OP_CREATE)
unlink(name);
errno = save_errno;
[parent: 5b0fa06f65e9]