aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/error/elog.c
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2024-02-14 17:09:31 -0600
committerNathan Bossart <nathan@postgresql.org>2024-02-14 17:09:31 -0600
commit8fd0498de2005b4136aaf6fcd056ca4b18e37724 (patch)
treec747b9182bdb9657fa0d9e47a6c9011020e5c9d3 /src/backend/utils/error/elog.c
parent28e46325091dfac5c6ab9ea1e047a8d09dbd16e7 (diff)
downloadpostgresql-8fd0498de2005b4136aaf6fcd056ca4b18e37724.tar.gz
postgresql-8fd0498de2005b4136aaf6fcd056ca4b18e37724.zip
Remove obsolete check in SIGTERM handler for the startup process.
Thanks to commit 3b00fdba9f, this check in the SIGTERM handler for the startup process is now obsolete and can be removed. Instead of leaving around the dead function write_stderr_signal_safe(), I've opted to just remove it for now. This partially reverts commit 97550c0711. Reviewed-by: Andres Freund, Noah Misch Discussion: https://postgr.es/m/20231121212008.GA3742740%40nathanxps13
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r--src/backend/utils/error/elog.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 700fbde6db4..bba00a0087f 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -3737,31 +3737,3 @@ write_stderr(const char *fmt,...)
#endif
va_end(ap);
}
-
-
-/*
- * Write a message to STDERR using only async-signal-safe functions. This can
- * be used to safely emit a message from a signal handler.
- *
- * TODO: It is likely possible to safely do a limited amount of string
- * interpolation (e.g., %s and %d), but that is not presently supported.
- */
-void
-write_stderr_signal_safe(const char *str)
-{
- int nwritten = 0;
- int ntotal = strlen(str);
-
- while (nwritten < ntotal)
- {
- int rc;
-
- rc = write(STDERR_FILENO, str + nwritten, ntotal - nwritten);
-
- /* Just give up on error. There isn't much else we can do. */
- if (rc == -1)
- return;
-
- nwritten += rc;
- }
-}