aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/storage/ipc/dsm_impl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c
index 33a27b3a452..44962af32cd 100644
--- a/src/backend/storage/ipc/dsm_impl.c
+++ b/src/backend/storage/ipc/dsm_impl.c
@@ -362,7 +362,8 @@ dsm_impl_posix_resize(int fd, off_t size)
* allowed SIGUSR1 to interrupt us repeatedly (for example, due to recovery
* conflicts), the retry loop might never succeed.
*/
- PG_SETMASK(&BlockSig);
+ if (IsUnderPostmaster)
+ PG_SETMASK(&BlockSig);
/* Truncate (or extend) the file to the requested size. */
do
@@ -402,9 +403,12 @@ dsm_impl_posix_resize(int fd, off_t size)
}
#endif /* HAVE_POSIX_FALLOCATE && __linux__ */
- save_errno = errno;
- PG_SETMASK(&UnBlockSig);
- errno = save_errno;
+ if (IsUnderPostmaster)
+ {
+ save_errno = errno;
+ PG_SETMASK(&UnBlockSig);
+ errno = save_errno;
+ }
return rc;
}