--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -3773,7 +3773,7 @@ retry:
                pagelsn.xrecoff = 0;
            }
            /* Wait for the next page to become available */
-           if (!XLogPageRead(&pagelsn, emode, false, false))
+           if (!XLogPageRead(&pagelsn, emode_arg, false, false))
                return NULL;

            /* Check that the continuation record looks valid */
