summaryrefslogtreecommitdiff
path: root/contrib/pg_prewarm
diff options
context:
space:
mode:
authorTom Lane2018-05-02 19:52:54 +0000
committerTom Lane2018-05-02 19:52:54 +0000
commitfbb2e9a030ee7a3fa20ce402e4b1da9809b4eb52 (patch)
tree79bd48ec2dccce2957bf56d62019f24a86ab181c /contrib/pg_prewarm
parent447dbf7aa7909bca76048042d6734ee8f5249d0f (diff)
Fix assorted compiler warnings seen in the buildfarm.
Failure to use DatumGetFoo/FooGetDatum macros correctly, or at all, causes some warnings about sign conversion. This is just cosmetic at the moment but in principle it's a type violation, so clean up the instances I could find. autoprewarm.c and sharedfileset.c contained code that unportably assumed that pid_t is the same size as int. We've variously dealt with this by casting pid_t to int or to unsigned long for printing purposes; I went with the latter. Fix uninitialized-variable warning in RestoreGUCState. This is a live bug in some sense, but of no great significance given that nobody is very likely to care what "line number" is associated with a GUC that hasn't got a source file recorded.
Diffstat (limited to 'contrib/pg_prewarm')
-rw-r--r--contrib/pg_prewarm/autoprewarm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c
index bb28e237d1..9faabe576d 100644
--- a/contrib/pg_prewarm/autoprewarm.c
+++ b/contrib/pg_prewarm/autoprewarm.c
@@ -180,8 +180,8 @@ autoprewarm_main(Datum main_arg)
{
LWLockRelease(&apw_state->lock);
ereport(LOG,
- (errmsg("autoprewarm worker is already running under PID %d",
- apw_state->bgworker_pid)));
+ (errmsg("autoprewarm worker is already running under PID %lu",
+ (unsigned long) apw_state->bgworker_pid)));
return;
}
apw_state->bgworker_pid = MyProcPid;
@@ -290,8 +290,8 @@ apw_load_buffers(void)
{
LWLockRelease(&apw_state->lock);
ereport(LOG,
- (errmsg("skipping prewarm because block dump file is being written by PID %d",
- apw_state->pid_using_dumpfile)));
+ (errmsg("skipping prewarm because block dump file is being written by PID %lu",
+ (unsigned long) apw_state->pid_using_dumpfile)));
return;
}
LWLockRelease(&apw_state->lock);
@@ -580,12 +580,12 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
{
if (!is_bgworker)
ereport(ERROR,
- (errmsg("could not perform block dump because dump file is being used by PID %d",
- apw_state->pid_using_dumpfile)));
+ (errmsg("could not perform block dump because dump file is being used by PID %lu",
+ (unsigned long) apw_state->pid_using_dumpfile)));
ereport(LOG,
- (errmsg("skipping block dump because it is already being performed by PID %d",
- apw_state->pid_using_dumpfile)));
+ (errmsg("skipping block dump because it is already being performed by PID %lu",
+ (unsigned long) apw_state->pid_using_dumpfile)));
return 0;
}
@@ -717,8 +717,8 @@ autoprewarm_start_worker(PG_FUNCTION_ARGS)
if (pid != InvalidPid)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("autoprewarm worker is already running under PID %d",
- pid)));
+ errmsg("autoprewarm worker is already running under PID %lu",
+ (unsigned long) pid)));
apw_start_master_worker();