--- a/src/backend/access/transam/xlog.c	2013-03-04 15:13:49.000000000 -0500
+++ b/src/backend/access/transam/xlog.c	2013-03-05 06:43:49.435093827 -0500
@@ -4446,7 +4446,7 @@
 	if (targetTLI == 1)
 		return list_make1_int((int) targetTLI);
 
-	if (InArchiveRecovery)
+	if (ArchiveRecoveryRequested)
 	{
 		TLHistoryFileName(histfname, targetTLI);
 		fromArchive =
@@ -10603,8 +10603,11 @@
 				readFile = XLogFileReadAnyTLI(readId, readSeg, emode,
 											  sources);
 				switched_segment = true;
-				if (readFile < 0)
+				if (readFile < 0){
+					if (StandbyModeRequested)
+						return true;
 					return false;
+				}
 			}
 		}
 	}
