Commit 36614006 authored by Tom Lane's avatar Tom Lane

Avoid useless snprintf() call when update_process_title is turned off.

Fujii Masao
parent 3e7451a6
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/walreceiver.c,v 1.11 2010/06/03 22:17:32 tgl Exp $ * $PostgreSQL: pgsql/src/backend/replication/walreceiver.c,v 1.12 2010/06/07 15:49:30 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -524,7 +524,6 @@ XLogWalRcvFlush(void) ...@@ -524,7 +524,6 @@ XLogWalRcvFlush(void)
{ {
/* use volatile pointer to prevent code rearrangement */ /* use volatile pointer to prevent code rearrangement */
volatile WalRcvData *walrcv = WalRcv; volatile WalRcvData *walrcv = WalRcv;
char activitymsg[50];
issue_xlog_fsync(recvFile, recvId, recvSeg); issue_xlog_fsync(recvFile, recvId, recvSeg);
...@@ -536,8 +535,14 @@ XLogWalRcvFlush(void) ...@@ -536,8 +535,14 @@ XLogWalRcvFlush(void)
SpinLockRelease(&walrcv->mutex); SpinLockRelease(&walrcv->mutex);
/* Report XLOG streaming progress in PS display */ /* Report XLOG streaming progress in PS display */
snprintf(activitymsg, sizeof(activitymsg), "streaming %X/%X", if (update_process_title)
LogstreamResult.Write.xlogid, LogstreamResult.Write.xrecoff); {
set_ps_display(activitymsg, false); char activitymsg[50];
snprintf(activitymsg, sizeof(activitymsg), "streaming %X/%X",
LogstreamResult.Write.xlogid,
LogstreamResult.Write.xrecoff);
set_ps_display(activitymsg, false);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment