Author: Ole Streicher <debian@liska.ath.cx>
Description: Replace exit() by abort() in shared libs.
--- a/vimos/vmcube.c
+++ b/vimos/vmcube.c
@@ -54,7 +54,7 @@
   /* check if space was allocated */
   if (theCube == NULL) 
     {
-     exit(-1);
+       abort();
     }
     
   /* a VimosCube is only an interface to a Fits Image. */
@@ -86,7 +86,7 @@
     {
      /* cleanup */
      deleteCube(tmpCube);
-     exit(-1);
+     abort();
     }
   
   return(tmpCube);
--- a/vimos/vmfit.c
+++ b/vimos/vmfit.c
@@ -1253,7 +1253,7 @@
                else if (iPivot[k] > 1)
                  {
                   puts("gaussJordan: Singular Matrix-1");
-                  exit(-1);
+                  abort();
                  }
 	      }
       ++(iPivot[iCol]);
@@ -1267,7 +1267,7 @@
       if (a[iCol][iCol] == 0.0)
         {
          puts("gaussJordan: Singular Matrix-2");
-         exit(-1);
+         abort();
         }
       pivotInv = 1.0 / a[iCol][iCol];
       a[iCol][iCol] = 1.0;
@@ -1670,7 +1670,7 @@
   if ((nTerms < 3) || (nTerms > 6))
     {
      puts(" fit1DGauss: nTerms at least 3, at most 6");
-     exit(-1);
+     abort();
     }
 
   /* to work with curvefit it is better to have arrays. I transform to    */
--- a/vimos/vmifutypes.c
+++ b/vimos/vmifutypes.c
@@ -64,7 +64,7 @@
   /* error occured, exit */
   if (newPData == NULL)
     {
-     exit(-1);
+     abort();
     }
 
   /* fill up fields with default values */
@@ -118,7 +118,7 @@
   /* error occured, exit */
   if (newPList == NULL)
     {
-     exit(-1);
+     abort();
     }
 
   /* fill up fields with default values */
@@ -173,7 +173,7 @@
   /* error occured, exit */
   if (newPRegion == NULL)
     {
-     exit(-1);
+     abort();
     }
 
   /* fill up fields with default values */
@@ -404,7 +404,7 @@
   if (ngoodpix > (int)(0.6 * (double)numMapPix))
     {
      puts("findRegionsOnPixelMap: more than 60% of good pixel. Exiting");
-     exit(-1);
+     abort();
     }
 
   /* Allocate memory: we will store a pixel position and a boolean flag */
--- a/vimos/vmimageset.c
+++ b/vimos/vmimageset.c
@@ -76,7 +76,7 @@
 
   /* error occured, exit */
   if (theSingleImage == NULL) {
-    exit(-1);
+    abort();
   }
 
   /* fill up fields with default values */
@@ -188,7 +188,7 @@
 
   /* if error: exit */
   if (theImageSet == NULL) {
-    exit(-1);
+    abort();
   }
 
   theImageSet->images = NULL;
@@ -289,7 +289,7 @@
   if ((ifp = fopen(imageList,"r")) == NULL)
     {
      printf("Can't open file %s. \n", imageList);
-     exit(1);
+     abort();
     }
 
   lastOneImage = NULL;
--- a/vimos/vmmatrix.c
+++ b/vimos/vmmatrix.c
@@ -534,7 +534,7 @@
   v = (int *)pil_malloc((size_t) ((nhigh-nlow+1+RANGE_END)*sizeof(int)));
   if (!v)
     {
-     exit(-1);
+     abort();
     }
 
   return v-nlow+RANGE_END;
@@ -561,7 +561,7 @@
   v = (float *)pil_malloc((size_t) ((nhigh-nlow+1+RANGE_END)*sizeof(float)));
   if (!v)
     {
-     exit(-1);
+     abort();
     }
   return v-nlow+RANGE_END;
 }
@@ -578,7 +578,7 @@
   v = (double *)pil_malloc((size_t) ((nhigh-nlow+1+RANGE_END)*sizeof(double)));
   if (!v)
     {
-     exit(-1);
+     abort();
     }
   return v-nlow+RANGE_END;
 }
@@ -617,7 +617,7 @@
         
   if (!m)
     {
-     exit(-1);
+     abort();
     }
   m += RANGE_END;
   m -= nrl;
@@ -626,7 +626,7 @@
 
   if (!m[nrl])
     {
-     exit(-1);
+     abort();
     }
 
   m[nrl] += RANGE_END;
@@ -659,14 +659,14 @@
 	/* allocate pointers to rows */
 	m=(double **) pil_malloc((size_t)((nrow+RANGE_END)*sizeof(double*)));
 	if (!m) {
-	  exit(-1) ;
+	  abort();
 	}
 	m += RANGE_END;
 	m -= nrl;
 
 	/* allocate rows and set pointers to them */
 	m[nrl]=(double *) pil_malloc((size_t)((nrow*ncol+RANGE_END)*sizeof(double)));
-	if (!m[nrl]) exit(-1);
+	if (!m[nrl]) abort();
 	m[nrl] += RANGE_END;
 	m[nrl] -= ncl;
 
@@ -704,7 +704,7 @@
 
   if (!m)
     {
-     exit(-1);
+     abort();
     }
 
   m += RANGE_END;
@@ -760,14 +760,14 @@
   
   tArray = (VimosFloat2DArray *) pil_malloc(sizeof(VimosFloat2DArray));
   if (tArray == NULL) {
-    exit(-2);
+    abort();
   }
   
   tArray->x = (float *) pil_calloc(len, sizeof(float));
   tArray->y = (float *) pil_calloc(len, sizeof(float));
   if ( (tArray->x == NULL) || (tArray->y == NULL) ) {
     pil_free(tArray);
-    exit(-1);
+    abort();
   }
   
   tArray->len = len;
--- a/vimos/vmqcutils.c
+++ b/vimos/vmqcutils.c
@@ -71,7 +71,7 @@
     if (s[0]==0) return 0 ;
     if (regcomp(&re_int, &regex_int[0], REG_EXTENDED|REG_NOSUB)!=0) {
         printf("internal error: compiling int rule");
-        exit(-1);
+        abort();
     }
     status = regexec(&re_int, s, 0, NULL, 0) ;
     regfree(&re_int) ;
@@ -87,7 +87,7 @@
     if (s[0]==0) return 0 ;
     if (regcomp(&re_float, &regex_float[0], REG_EXTENDED|REG_NOSUB)!=0) {
         printf("internal error: compiling float rule");
-        exit(-1);
+        abort();
     }
     status = regexec(&re_float, s, 0, NULL, 0) ;
     regfree(&re_float) ;
@@ -112,7 +112,7 @@
     if (s[0]==0) return 0 ;
     if (regcomp(&re_cmp, &regex_cmp[0], REG_EXTENDED|REG_NOSUB)!=0) {
         printf("internal error: compiling complex rule");
-        exit(-1);
+        abort();
     }
     status = regexec(&re_cmp, s, 0, NULL, 0) ;
     regfree(&re_cmp) ;
--- a/libpil/pil/pilrecipe.c
+++ b/libpil/pil/pilrecipe.c
@@ -1578,12 +1578,12 @@
     switch (c) {
     case 'h':
       pilRecUsage(parg);
-      exit(0);
+      return NULL;
       break;
 
     case 'V':
       pilRecVersion();
-      exit(0);
+      return NULL;
       break;
 
     case 'D':
@@ -1852,7 +1852,7 @@
     if (dump_file)
       pil_free(dump_file);
 
-    exit(status);
+    return NULL;
   }
 
 
