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
* On Windows, currently this does not work, so control-C is less useful
* there.
*/
-volatile bool sigint_interrupt_enabled = false;
+volatile sig_atomic_t sigint_interrupt_enabled = false;
sigjmp_buf sigint_interrupt_jmp;
#define COMMON_H
#include <setjmp.h>
+#include <signal.h>
#include "fe_utils/print.h"
#include "fe_utils/psqlscan.h"
extern void NoticeProcessor(void *arg, const char *message);
-extern volatile bool sigint_interrupt_enabled;
+extern volatile sig_atomic_t sigint_interrupt_enabled;
extern sigjmp_buf sigint_interrupt_jmp;
#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;