snapshot: rearrange #if a little
[c11tester.git] / snapshot.cc
index 0d8094fcc76ad9cd63c1ee0af229a383a925cf6c..db597a2a0f7fa5dd8e43aa67129cfa9341cc563a 100644 (file)
@@ -72,13 +72,11 @@ static void initSnapShotRecord(unsigned int numbackingpages, unsigned int numsna
        snapshotrecord->maxBackingPages=numbackingpages;
        snapshotrecord->maxSnapShots=numsnapshots;
 }
-#endif //nothing to initialize for the fork based snapshotting.
 
 /** HandlePF is the page fault handler for mprotect based snapshotting
  * algorithm.
  */
 static void HandlePF( int sig, siginfo_t *si, void * unused){
-#if USE_MPROTECT_SNAPSHOT
        if( si->si_code == SEGV_MAPERR ){
                printf("Real Fault at %p\n", si->si_addr);
                exit( EXIT_FAILURE );
@@ -100,8 +98,8 @@ static void HandlePF( int sig, siginfo_t *si, void * unused){
                perror("mprotect");
                // Handle error by quitting?
        }
-#endif //nothing to handle for non snapshotting case.
 }
+#endif //nothing to handle for non snapshotting case.
 
 void createSharedLibrary(){
 #if !USE_MPROTECT_SNAPSHOT