diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-04-10 18:34:40 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-04-10 18:34:40 -0400 |
commit | 02ba72ec1cf541d735c993f11342784969f65b45 (patch) | |
tree | 68e6587b2efe81340109d11ae7c1810391f5ff9d | |
parent | 29ab1567e7ea4dccac75b60db3840db6f8859e40 (diff) | |
download | postgresql-02ba72ec1cf541d735c993f11342784969f65b45.tar.gz postgresql-02ba72ec1cf541d735c993f11342784969f65b45.zip |
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
-rw-r--r-- | src/backend/storage/ipc/dsm_impl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c index 1ec154cfe8d..738a025a0b4 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; |