[GRASS-SVN] r63467 - grass/trunk/display/d.mon
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Dec 10 01:45:32 PST 2014
Author: martinl
Date: 2014-12-10 01:45:32 -0800 (Wed, 10 Dec 2014)
New Revision: 63467
Modified:
grass/trunk/display/d.mon/start.c
Log:
d.mon: stop monitor on failure (#2509)
Modified: grass/trunk/display/d.mon/start.c
===================================================================
--- grass/trunk/display/d.mon/start.c 2014-12-10 09:37:08 UTC (rev 63466)
+++ grass/trunk/display/d.mon/start.c 2014-12-10 09:45:32 UTC (rev 63467)
@@ -10,6 +10,7 @@
static void start(const char *, const char *);
static void start_wx(const char *, const char *, const char *,
const char *, int, int);
+static void error_handler(void *);
/* start file-based monitor */
void start(const char *name, const char *output)
@@ -17,6 +18,9 @@
char *env_name, output_path[GPATH_MAX];
const char *output_name;
+ /* stop monitor on failure */
+ G_add_error_handler(error_handler, (char *)name);
+
if (!output) {
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected. "
@@ -176,3 +180,9 @@
return 0;
}
+
+void error_handler(void *p)
+{
+ const char *name = (const char *) p;
+ stop_mon(name);
+}
More information about the grass-commit
mailing list