Browse Source

Protect against fatal error handlers calling G_fatal_error()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40465 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 years ago
parent
commit
c9b954a931
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lib/gis/error.c

+ 5 - 0
lib/gis/error.c

@@ -146,8 +146,13 @@ void G_important_message(const char *msg, ...)
  */
 void 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);