]> granicus.if.org Git - postgresql/commitdiff
Assign InvalidXLogRecPtr instead of MemSet(0)
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 27 Dec 2012 21:33:03 +0000 (18:33 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 27 Dec 2012 21:33:03 +0000 (18:33 -0300)
For consistency.

Author: Andres Freund

src/backend/access/transam/xlog.c
src/backend/replication/walsender.c

index 54df3e6df94b304797b69270a4fbcaae95baee61..0b1a9c21d5b560d6a39944410ec16d8b3f30abea 100644 (file)
@@ -6393,8 +6393,8 @@ CheckRecoveryConsistency(void)
                if (XLByteLT(ControlFile->minRecoveryPoint, EndRecPtr))
                        ControlFile->minRecoveryPoint = EndRecPtr;
 
-               MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr));
-               MemSet(&ControlFile->backupEndPoint, 0, sizeof(XLogRecPtr));
+               ControlFile->backupStartPoint = InvalidXLogRecPtr;
+               ControlFile->backupEndPoint = InvalidXLogRecPtr;
                ControlFile->backupEndRequired = false;
                UpdateControlFile();
 
@@ -7330,7 +7330,7 @@ CreateCheckPoint(int flags)
        ControlFile->checkPointCopy = checkPoint;
        ControlFile->time = (pg_time_t) time(NULL);
        /* crash recovery should always recover to the end of WAL */
-       MemSet(&ControlFile->minRecoveryPoint, 0, sizeof(XLogRecPtr));
+       ControlFile->minRecoveryPoint = InvalidXLogRecPtr;
        ControlFile->minRecoveryPointTLI = 0;
        UpdateControlFile();
        LWLockRelease(ControlFileLock);
@@ -8161,7 +8161,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
                                ControlFile->minRecoveryPoint = lsn;
                                ControlFile->minRecoveryPointTLI = ThisTimeLineID;
                        }
-                       MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr));
+                       ControlFile->backupStartPoint = InvalidXLogRecPtr;
                        ControlFile->backupEndRequired = false;
                        UpdateControlFile();
 
index 74357ace295d1aaf4dac2360cc6a69b3a783a1ce..df6ad6df7bb44c4ebe308b11aa49177f37cbfd6a 100644 (file)
@@ -1115,7 +1115,7 @@ InitWalSenderSlot(void)
                         * Found a free slot. Reserve it for us.
                         */
                        walsnd->pid = MyProcPid;
-                       MemSet(&walsnd->sentPtr, 0, sizeof(XLogRecPtr));
+                       walsnd->sentPtr = InvalidXLogRecPtr;
                        walsnd->state = WALSNDSTATE_STARTUP;
                        SpinLockRelease(&walsnd->mutex);
                        /* don't need the lock anymore */