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

Commitb66fbd8

Browse files
committed
Use SIGNAL_ARGS consistently to declare signal handlers.
Various bits of code were declaring signal handlers manually,using "int signum" or variants of that. We evidently have noplatforms where that's actually wrong, but let's use ourSIGNAL_ARGS macro everywhere anyway. If nothing else, it'sgood for finding signal handlers easily.No need for back-patch, since this is just cosmetic AFAICS.Discussion:https://postgr.es/m/2684964.1663167995@sss.pgh.pa.us
1 parentab39352 commitb66fbd8

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

‎src/backend/storage/ipc/pmsignal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ NON_EXEC_STATIC volatile PMSignalData *PMSignalState = NULL;
8888
volatilesig_atomic_tpostmaster_possibly_dead= false;
8989

9090
staticvoid
91-
postmaster_death_handler(intsigno)
91+
postmaster_death_handler(SIGNAL_ARGS)
9292
{
9393
postmaster_possibly_dead= true;
9494
}

‎src/bin/initdb/initdb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static void load_plpgsql(FILE *cmdfd);
268268
staticvoidvacuum_db(FILE*cmdfd);
269269
staticvoidmake_template0(FILE*cmdfd);
270270
staticvoidmake_postgres(FILE*cmdfd);
271-
staticvoidtrapsig(intsignum);
271+
staticvoidtrapsig(SIGNAL_ARGS);
272272
staticvoidcheck_ok(void);
273273
staticchar*escape_quotes(constchar*src);
274274
staticchar*escape_quotes_bki(constchar*src);
@@ -1848,10 +1848,10 @@ make_postgres(FILE *cmdfd)
18481848
* So this will need some testing on Windows.
18491849
*/
18501850
staticvoid
1851-
trapsig(intsignum)
1851+
trapsig(SIGNAL_ARGS)
18521852
{
18531853
/* handle systems that reset the handler, like Windows (grr) */
1854-
pqsignal(signum,trapsig);
1854+
pqsignal(postgres_signal_arg,trapsig);
18551855
caught_signal= true;
18561856
}
18571857

‎src/bin/pg_basebackup/pg_receivewal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ StreamLog(void)
679679
#ifndefWIN32
680680

681681
staticvoid
682-
sigexit_handler(intsignum)
682+
sigexit_handler(SIGNAL_ARGS)
683683
{
684684
time_to_stop= true;
685685
}

‎src/bin/pg_basebackup/pg_recvlogical.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ StreamLogicalLog(void)
654654
* possible moment.
655655
*/
656656
staticvoid
657-
sigexit_handler(intsignum)
657+
sigexit_handler(SIGNAL_ARGS)
658658
{
659659
time_to_abort= true;
660660
}
@@ -663,7 +663,7 @@ sigexit_handler(int signum)
663663
* Trigger the output file to be reopened.
664664
*/
665665
staticvoid
666-
sighup_handler(intsignum)
666+
sighup_handler(SIGNAL_ARGS)
667667
{
668668
output_reopen= true;
669669
}

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ read_post_opts(void)
850850
* waiting for the server to start up, the server launch is aborted.
851851
*/
852852
staticvoid
853-
trap_sigint_during_startup(intsig)
853+
trap_sigint_during_startup(SIGNAL_ARGS)
854854
{
855855
if (postmasterPID!=-1)
856856
{
@@ -863,8 +863,8 @@ trap_sigint_during_startup(int sig)
863863
* Clear the signal handler, and send the signal again, to terminate the
864864
* process as normal.
865865
*/
866-
pqsignal(SIGINT,SIG_DFL);
867-
raise(SIGINT);
866+
pqsignal(postgres_signal_arg,SIG_DFL);
867+
raise(postgres_signal_arg);
868868
}
869869

870870
staticchar*

‎src/bin/pg_test_fsync/pg_test_fsync.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ static void test_open_sync(const char *msg, int writes_size);
8181
staticvoidtest_file_descriptor_sync(void);
8282

8383
#ifndefWIN32
84-
staticvoidprocess_alarm(intsig);
84+
staticvoidprocess_alarm(SIGNAL_ARGS);
8585
#else
8686
staticDWORDWINAPIprocess_alarm(LPVOIDparam);
8787
#endif
88-
staticvoidsignal_cleanup(intsig);
88+
staticvoidsignal_cleanup(SIGNAL_ARGS);
8989

9090
#ifdefHAVE_FSYNC_WRITETHROUGH
9191
staticintpg_fsync_writethrough(intfd);
@@ -590,14 +590,14 @@ test_non_sync(void)
590590
}
591591

592592
staticvoid
593-
signal_cleanup(intsignum)
593+
signal_cleanup(SIGNAL_ARGS)
594594
{
595595
/* Delete the file if it exists. Ignore errors */
596596
if (needs_unlink)
597597
unlink(filename);
598598
/* Finish incomplete line on stdout */
599599
puts("");
600-
exit(signum);
600+
exit(1);
601601
}
602602

603603
#ifdefHAVE_FSYNC_WRITETHROUGH
@@ -632,7 +632,7 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops)
632632

633633
#ifndefWIN32
634634
staticvoid
635-
process_alarm(intsig)
635+
process_alarm(SIGNAL_ARGS)
636636
{
637637
alarm_triggered= true;
638638
}

‎src/bin/pg_waldump/pg_waldump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ typedef struct XLogDumpConfig
8080
#ifndefWIN32
8181

8282
staticvoid
83-
sigint_handler(intsignum)
83+
sigint_handler(SIGNAL_ARGS)
8484
{
8585
time_to_stop= true;
8686
}

‎src/include/port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ extern intpg_check_dir(const char *dir);
472472
externintpg_mkdir_p(char*path,intomode);
473473

474474
/* port/pqsignal.c */
475-
typedefvoid (*pqsigfunc) (intsigno);
475+
typedefvoid (*pqsigfunc) (SIGNAL_ARGS);
476476
externpqsigfuncpqsignal(intsigno,pqsigfuncfunc);
477477

478478
/* port/quotes.c */

‎src/test/regress/pg_regress.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,12 @@ remove_temp(void)
303303
* Signal handler that calls remove_temp() and reraises the signal.
304304
*/
305305
staticvoid
306-
signal_remove_temp(intsignum)
306+
signal_remove_temp(SIGNAL_ARGS)
307307
{
308308
remove_temp();
309309

310-
pqsignal(signum,SIG_DFL);
311-
raise(signum);
310+
pqsignal(postgres_signal_arg,SIG_DFL);
311+
raise(postgres_signal_arg);
312312
}
313313

314314
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp