summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut2022-10-14 06:37:12 +0000
committerPeter Eisentraut2022-10-14 06:38:53 +0000
commit1b11561cc1de7596f6f7cb750743af94b9d168f7 (patch)
treea16c63b0dfd1d35a520337f5342f8cf59c0ffd1e /src
parent34df7b9dfdeee442cf43060b6499bedc5f619f7f (diff)
Standardize format for printing PIDs
Most code prints PIDs as %d, but some code tried to print them as long or unsigned long. While this is in theory allowed, the fact that PIDs fit into int is deeply baked into all PostgreSQL code, so these random deviations don't accomplish anything except confusion. Note that we still need casts from pid_t to int, because on 64-bit MinGW, pid_t is long long int. (But per above, actually supporting that range in PostgreSQL code would be major surgery and probably not useful.) Discussion: https://www.postgresql.org/message-id/[email protected]
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/bgworker.c4
-rw-r--r--src/backend/storage/ipc/procsignal.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index 8dd7d64630c..0d72de24b02 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -389,8 +389,8 @@ BackgroundWorkerStateChange(bool allow_new_workers)
rw->rw_worker.bgw_notify_pid = slot->worker.bgw_notify_pid;
if (!PostmasterMarkPIDForWorkerNotify(rw->rw_worker.bgw_notify_pid))
{
- elog(DEBUG1, "worker notification PID %ld is not valid",
- (long) rw->rw_worker.bgw_notify_pid);
+ elog(DEBUG1, "worker notification PID %d is not valid",
+ (int) rw->rw_worker.bgw_notify_pid);
rw->rw_worker.bgw_notify_pid = 0;
}
diff --git a/src/backend/storage/ipc/procsignal.c b/src/backend/storage/ipc/procsignal.c
index 21a9fc0fdd2..7767657f271 100644
--- a/src/backend/storage/ipc/procsignal.c
+++ b/src/backend/storage/ipc/procsignal.c
@@ -416,8 +416,8 @@ WaitForProcSignalBarrier(uint64 generation)
5000,
WAIT_EVENT_PROC_SIGNAL_BARRIER))
ereport(LOG,
- (errmsg("still waiting for backend with PID %lu to accept ProcSignalBarrier",
- (unsigned long) slot->pss_pid)));
+ (errmsg("still waiting for backend with PID %d to accept ProcSignalBarrier",
+ (int) slot->pss_pid)));
oldval = pg_atomic_read_u64(&slot->pss_barrierGeneration);
}
ConditionVariableCancelSleep();