3030 *
3131 *
3232 * IDENTIFICATION
33- * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.22 2010/05/26 22:34:49 heikki Exp $
33+ * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.23 2010/05/31 10:44:37 heikki Exp $
3434 *
3535 *-------------------------------------------------------------------------
3636 */
@@ -394,8 +394,10 @@ WalSndLoop(void)
394394 */
395395if (ready_to_stop )
396396{
397- XLogSend (& output_message ,& caughtup );
398- shutdown_requested = true;
397+ if (!XLogSend (& output_message ,& caughtup ))
398+ gotoeof ;
399+ if (caughtup )
400+ shutdown_requested = true;
399401}
400402
401403/* Normal exit from the walsender is here */
@@ -458,7 +460,6 @@ WalSndLoop(void)
458460static void
459461InitWalSnd (void )
460462{
461- /* use volatile pointer to prevent code rearrangement */
462463int i ;
463464
464465/*
@@ -474,6 +475,7 @@ InitWalSnd(void)
474475 */
475476for (i = 0 ;i < max_wal_senders ;i ++ )
476477{
478+ /* use volatile pointer to prevent code rearrangement */
477479volatile WalSnd * walsnd = & WalSndCtl -> walsnds [i ];
478480
479481SpinLockAcquire (& walsnd -> mutex );