[GRASS-SVN] r54870 - grass/trunk/lib/db/dbmi_driver
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 3 06:17:21 PST 2013
Author: mmetz
Date: 2013-02-03 06:17:21 -0800 (Sun, 03 Feb 2013)
New Revision: 54870
Modified:
grass/trunk/lib/db/dbmi_driver/d_error.c
Log:
dbmi_driver lib: fix driver error state
Modified: grass/trunk/lib/db/dbmi_driver/d_error.c
===================================================================
--- grass/trunk/lib/db/dbmi_driver/d_error.c 2013-02-03 12:31:05 UTC (rev 54869)
+++ grass/trunk/lib/db/dbmi_driver/d_error.c 2013-02-03 14:17:21 UTC (rev 54870)
@@ -21,15 +21,22 @@
#include <grass/glocale.h>
/* initialize the global struct */
-struct state {
+struct error_state {
char *driver_name;
dbString *errMsg;
-} state;
+};
-struct state *st = &state;
+static struct error_state state;
+static struct error_state *st = &state;
-static void init();
+static void init()
+{
+ db_set_string(st->errMsg, "");
+ db_d_append_error(_("DBMI-%s driver error:"), st->driver_name);
+ db_append_string(st->errMsg, "\n");
+}
+
/*!
\brief Init error message for DB driver
@@ -51,12 +58,6 @@
init();
}
-void init()
-{
- db_set_string(st->errMsg, "");
- db_d_append_error(_("DBMI-%s driver error:"), st->driver_name);
- db_append_string(st->errMsg, "\n");
-}
/*!
\brief Append error message for DB driver
More information about the grass-commit
mailing list