From bda6dedbea599209048bc51115ecb2062ceb976c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 25 Mar 2020 11:57:36 -0400 Subject: Go back to returning int from ereport auxiliary functions. This reverts the parts of commit 17a28b03645e27d73bf69a95d7569b61e58f06eb that changed ereport's auxiliary functions from returning dummy integer values to returning void. It turns out that a minority of compilers complain (not entirely unreasonably) about constructs such as (condition) ? errdetail(...) : 0 if errdetail() returns void rather than int. We could update those call sites to say "(void) 0" perhaps, but the expectation for this patch set was that ereport callers would not have to change anything. And this aspect of the patch set was already the most invasive and least compelling part of it, so let's just drop it. Per buildfarm. Discussion: https://postgr.es/m/CA+fd4k6N8EjNvZpM8nme+y+05mz-SM8Z_BgkixzkA34R+ej0Kw@mail.gmail.com --- src/backend/storage/ipc/dsm_impl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/storage/ipc') diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c index 8dc9c0b5cdf..1972aecbedc 100644 --- a/src/backend/storage/ipc/dsm_impl.c +++ b/src/backend/storage/ipc/dsm_impl.c @@ -92,7 +92,7 @@ static bool dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size, void **impl_private, void **mapped_address, Size *mapped_size, int elevel); #endif -static void errcode_for_dynamic_shared_memory(void); +static int errcode_for_dynamic_shared_memory(void); const struct config_enum_entry dynamic_shared_memory_options[] = { #ifdef USE_DSM_POSIX @@ -1030,11 +1030,11 @@ dsm_impl_unpin_segment(dsm_handle handle, void **impl_private) } } -static void +static int errcode_for_dynamic_shared_memory(void) { if (errno == EFBIG || errno == ENOMEM) - errcode(ERRCODE_OUT_OF_MEMORY); + return errcode(ERRCODE_OUT_OF_MEMORY); else - errcode_for_file_access(); + return errcode_for_file_access(); } -- cgit v1.2.3