From 41ab724905b87dd698c3622acbe2d29491f1c7cd Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 19 Jun 2003 14:13:58 +0000 Subject: Changed PUGH_Abort() to return with the given return code to abort with (and not with 0 as it was before). This fixes PR CactusPUGH/1546. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@411 b61c5cb5-eaca-4651-9a7a-d64986f99364 --- src/SetupPGH.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/SetupPGH.c b/src/SetupPGH.c index 4abb52e..459c4f2 100644 --- a/src/SetupPGH.c +++ b/src/SetupPGH.c @@ -95,13 +95,13 @@ pGH *PUGH_SetupPGH (void *callerid, /* Allocate for myself */ - pughGH = (pGH *) malloc (sizeof (pGH)); + pughGH = malloc (sizeof (pGH)); /* Set an identifier for my parent */ pughGH->callerid = callerid; - pughGH->GFExtras = (pGExtras **) malloc (dim * sizeof (pGExtras *)); - pughGH->Connectivity = (pConnectivity **) malloc (dim*sizeof(pConnectivity*)); + pughGH->GFExtras = malloc (dim * sizeof (pGExtras *)); + pughGH->Connectivity = malloc (dim*sizeof(pConnectivity*)); /* Set the total number of processors */ Setup_nProcs (pughGH, dim); @@ -109,7 +109,7 @@ pGH *PUGH_SetupPGH (void *callerid, /* Set up connectivity and extras for each dimension */ for (idim = 1; idim <= dim; idim++) { - nprocs = (int *) malloc (idim * sizeof (int)); + nprocs = malloc (idim * sizeof (int)); PUGH_SetupDefaultTopology (idim, nprocs); @@ -451,7 +451,7 @@ int PUGH_Exit (cGH *GH, int retval) @returntype int @returndesc This function should never return. - But if it does it will return 0. + But if it does it will return the return code to abort with. @endreturndesc @@*/ int PUGH_Abort (cGH *GH, int retval) @@ -466,13 +466,12 @@ int PUGH_Abort (cGH *GH, int retval) #else /* avoid compiler warning about unused parameter */ GH = GH; - retval = retval; /* FIXME */ /*abort();*/ #endif - exit (0); - return (0); + exit (retval); + return (retval); } -- cgit v1.2.3