瀏覽代碼

Use G_add_error_handler() instead of G_set_error_routine()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40522 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 年之前
父節點
當前提交
154df259d2
共有 1 個文件被更改,包括 2 次插入9 次删除
  1. 2 9
      raster/r.mapcalc/evaluate.c

+ 2 - 9
raster/r.mapcalc/evaluate.c

@@ -241,13 +241,10 @@ static expr_list *exprs;
 
 /****************************************************************************/
 
-static int error_handler(const char *msg, int fatal)
+static void error_handler(void *p)
 {
     expr_list *l;
 
-    if (!fatal)
-	return 0;
-
     for (l = exprs; l; l = l->next) {
 	expression *e = l->exp;
 	int fd = e->data.bind.fd;
@@ -255,10 +252,6 @@ static int error_handler(const char *msg, int fatal)
 	if (fd >= 0)
 	    unopen_output_map(fd);
     }
-
-    G_unset_error_routine();
-    G_fatal_error("%s", msg);
-    return 0;
 }
 
 static void setup_rand(void)
@@ -291,7 +284,7 @@ void execute(expr_list * ee)
     setup_rand();
 
     exprs = ee;
-    G_set_error_routine(error_handler);
+    G_add_error_handler(error_handler, NULL);
 
     for (l = ee; l; l = l->next) {
 	expression *e = l->exp;