snapshot: kill useless macro
authorBrian Norris <banorris@uci.edu>
Fri, 5 Apr 2013 17:27:18 +0000 (10:27 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 5 Apr 2013 17:28:16 +0000 (10:28 -0700)
We're not reusing this macro, so it's better just to use the standard
perror() followed by exit().

snapshot.cc

index ba1c09034d6980bdfc1c841664c780668eee33b3..5069a1cf1147cb7afb07035cbf607c69daa2c284 100644 (file)
@@ -13,8 +13,6 @@
 #include "common.h"
 #include "context.h"
 
-#define FAILURE(mesg) { model_print("failed in the API: %s with errno relative message: %s\n", mesg, strerror(errno)); exit(EXIT_FAILURE); }
-
 /** PageAlignedAdressUpdate return a page aligned address for the
  * address being added as a side effect the numBytes are also changed.
  */
@@ -280,8 +278,10 @@ static void createSharedMemory()
 {
        //step 1. create shared memory.
        void *memMapBase = mmap(0, SHARED_MEMORY_DEFAULT + STACK_SIZE_DEFAULT, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
-       if (MAP_FAILED == memMapBase)
-               FAILURE("mmap");
+       if (memMapBase == MAP_FAILED) {
+               perror("mmap");
+               exit(EXIT_FAILURE);
+       }
 
        //Setup snapshot record at top of free region
        fork_snap = (struct fork_snapshotter *)memMapBase;