aboutsummaryrefslogtreecommitdiff
path: root/src/include/common/string.h
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-09-29 14:28:13 +0900
committerMichael Paquier <michael@paquier.xyz>2022-09-29 14:28:13 +0900
commit5ac9e869191148741539e626b84ba7e77dc71670 (patch)
treeee747f5173f7eb1cb3e376090ce761703eea2d39 /src/include/common/string.h
parentb8d8a4593a3a2daa5e16e4a3634d9284fe14667f (diff)
downloadpostgresql-5ac9e869191148741539e626b84ba7e77dc71670.tar.gz
postgresql-5ac9e869191148741539e626b84ba7e77dc71670.zip
Mark sigint_interrupt_enabled as sig_atomic_t
This is a continuation of 78fdb1e, where this flag is set in the psql callback handler used for SIGINT. This was previously a boolean but the C standard recommends the use of sig_atomic_t. Note that this influences PromptInterruptContext in string.h, where the same flag is tracked. Author: Hayato Kuroda Discussion: https://postgr.es/m/TYAPR01MB58669A9EC96AA3078C2CD938F5549@TYAPR01MB5866.jpnprd01.prod.outlook.com
Diffstat (limited to 'src/include/common/string.h')
-rw-r--r--src/include/common/string.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/common/string.h b/src/include/common/string.h
index 3d59172151b..32a923cf231 100644
--- a/src/include/common/string.h
+++ b/src/include/common/string.h
@@ -10,13 +10,15 @@
#ifndef COMMON_STRING_H
#define COMMON_STRING_H
+#include <signal.h>
+
struct StringInfoData; /* avoid including stringinfo.h here */
typedef struct PromptInterruptContext
{
/* To avoid including <setjmp.h> here, jmpbuf is declared "void *" */
void *jmpbuf; /* existing longjmp buffer */
- volatile bool *enabled; /* flag that enables longjmp-on-interrupt */
+ volatile sig_atomic_t *enabled; /* flag that enables longjmp-on-interrupt */
bool canceled; /* indicates whether cancellation occurred */
} PromptInterruptContext;