From: Brian Norris Date: Fri, 5 Apr 2013 17:27:18 +0000 (-0700) Subject: snapshot: kill useless macro X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=d775a7d6624fa14284c4a273d039bedd21a1f55c;ds=sidebyside snapshot: kill useless macro We're not reusing this macro, so it's better just to use the standard perror() followed by exit(). --- diff --git a/snapshot.cc b/snapshot.cc index ba1c0903..5069a1cf 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -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;