Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ac9e86

Browse files
committed
Mark sigint_interrupt_enabled as sig_atomic_t
This is a continuation of78fdb1e, where this flag is set in the psqlcallback handler used for SIGINT. This was previously a boolean but theC standard recommends the use of sig_atomic_t. Note that thisinfluences PromptInterruptContext in string.h, where the same flag istracked.Author: Hayato KurodaDiscussion:https://postgr.es/m/TYAPR01MB58669A9EC96AA3078C2CD938F5549@TYAPR01MB5866.jpnprd01.prod.outlook.com
1 parentb8d8a45 commit5ac9e86

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

‎src/bin/psql/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ NoticeProcessor(void *arg, const char *message)
246246
* On Windows, currently this does not work, so control-C is less useful
247247
* there.
248248
*/
249-
volatileboolsigint_interrupt_enabled= false;
249+
volatilesig_atomic_tsigint_interrupt_enabled= false;
250250

251251
sigjmp_bufsigint_interrupt_jmp;
252252

‎src/bin/psql/common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#defineCOMMON_H
1010

1111
#include<setjmp.h>
12+
#include<signal.h>
1213

1314
#include"fe_utils/print.h"
1415
#include"fe_utils/psqlscan.h"
@@ -22,7 +23,7 @@ extern char *psql_get_variable(const char *varname, PsqlScanQuoteType quote,
2223

2324
externvoidNoticeProcessor(void*arg,constchar*message);
2425

25-
externvolatileboolsigint_interrupt_enabled;
26+
externvolatilesig_atomic_tsigint_interrupt_enabled;
2627

2728
externsigjmp_bufsigint_interrupt_jmp;
2829

‎src/include/common/string.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
#ifndefCOMMON_STRING_H
1111
#defineCOMMON_STRING_H
1212

13+
#include<signal.h>
14+
1315
structStringInfoData;/* avoid including stringinfo.h here */
1416

1517
typedefstructPromptInterruptContext
1618
{
1719
/* To avoid including <setjmp.h> here, jmpbuf is declared "void *" */
1820
void*jmpbuf;/* existing longjmp buffer */
19-
volatilebool*enabled;/* flag that enables longjmp-on-interrupt */
21+
volatilesig_atomic_t*enabled;/* flag that enables longjmp-on-interrupt */
2022
boolcanceled;/* indicates whether cancellation occurred */
2123
}PromptInterruptContext;
2224

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp