[GRASS-SVN] r60002 - grass/branches/releasebranch_6_4/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 30 11:35:05 PDT 2014


Author: neteler
Date: 2014-04-30 11:35:05 -0700 (Wed, 30 Apr 2014)
New Revision: 60002

Modified:
   grass/branches/releasebranch_6_4/lib/gis/error.c
Log:
libgis: Protect against fatal error handlers calling G_fatal_error() (backport of trunk r40465, sloses trac #1073)

Modified: grass/branches/releasebranch_6_4/lib/gis/error.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/error.c	2014-04-30 18:17:57 UTC (rev 60001)
+++ grass/branches/releasebranch_6_4/lib/gis/error.c	2014-04-30 18:35:05 UTC (rev 60002)
@@ -3,7 +3,7 @@
  * 
  * \brief GIS Library: Error messages functions
  *
- * (C) 1999-2008 by the GRASS Development Team
+ * (C) 1999-2011 by the GRASS Development Team
  *
  * This program is free software under the GNU General Public
  * License (>=v2). Read the file COPYING that comes with GRASS
@@ -149,8 +149,13 @@
  */
 int G_fatal_error(const char *msg, ...)
 {
+    static int busy;
     va_list ap;
 
+    if (busy)
+	exit(EXIT_FAILURE);
+    busy = 1;
+
     va_start(ap, msg);
     vfprint_error(ERR, msg, ap);
     va_end(ap);
@@ -294,7 +299,7 @@
 		mail_msg(msg, fatal);
 	    }
 	}
-	else {			/* GUI */
+	else {	/* GUI */
 	    print_sentence(stderr, type, msg);
 	}
     }



More information about the grass-commit mailing list