From: Brian Norris Date: Thu, 14 Jun 2012 16:16:47 +0000 (-0700) Subject: snapshot: rearrange #if a little X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=8f0129627c5ba0b54b81f330abdba93bd8380fc0 snapshot: rearrange #if a little HandlePF() is only used in mprotect-based snapshotting, so keep it entirely within the #if block. --- diff --git a/snapshot.cc b/snapshot.cc index 0d8094fc..db597a2a 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -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