aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_test_fsync
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-09-14 14:44:45 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-09-14 14:44:50 -0400
commitb66fbd8afe6eb80e3e48495e002fda9aa92df583 (patch)
tree801155b20dee3af5b19d44c0f735ab5e1e7de132 /src/bin/pg_test_fsync
parentab393528fa4b2486237ee7aa51fac67f82fee824 (diff)
downloadpostgresql-b66fbd8afe6eb80e3e48495e002fda9aa92df583.tar.gz
postgresql-b66fbd8afe6eb80e3e48495e002fda9aa92df583.zip
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 no platforms where that's actually wrong, but let's use our SIGNAL_ARGS macro everywhere anyway. If nothing else, it's good 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
Diffstat (limited to 'src/bin/pg_test_fsync')
-rw-r--r--src/bin/pg_test_fsync/pg_test_fsync.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c
index 77f0db0376b..585b3ef7313 100644
--- a/src/bin/pg_test_fsync/pg_test_fsync.c
+++ b/src/bin/pg_test_fsync/pg_test_fsync.c
@@ -81,11 +81,11 @@ static void test_open_sync(const char *msg, int writes_size);
static void test_file_descriptor_sync(void);
#ifndef WIN32
-static void process_alarm(int sig);
+static void process_alarm(SIGNAL_ARGS);
#else
static DWORD WINAPI process_alarm(LPVOID param);
#endif
-static void signal_cleanup(int sig);
+static void signal_cleanup(SIGNAL_ARGS);
#ifdef HAVE_FSYNC_WRITETHROUGH
static int pg_fsync_writethrough(int fd);
@@ -590,14 +590,14 @@ test_non_sync(void)
}
static void
-signal_cleanup(int signum)
+signal_cleanup(SIGNAL_ARGS)
{
/* Delete the file if it exists. Ignore errors */
if (needs_unlink)
unlink(filename);
/* Finish incomplete line on stdout */
puts("");
- exit(signum);
+ exit(1);
}
#ifdef HAVE_FSYNC_WRITETHROUGH
@@ -632,7 +632,7 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops)
#ifndef WIN32
static void
-process_alarm(int sig)
+process_alarm(SIGNAL_ARGS)
{
alarm_triggered = true;
}