The global system name was not saved or restored from the configuration file.

Wed, 03 Sep 2014 15:38:01 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 03 Sep 2014 15:38:01 +0200
changeset 286
674efa17be1d
parent 285
bbe73c2ecacf
child 287
61be1e1711d3

The global system name was not saved or restored from the configuration file.

thermferm/rdconfig.c file | annotate | diff | comparison | revisions
--- a/thermferm/rdconfig.c	Wed Sep 03 15:29:46 2014 +0200
+++ b/thermferm/rdconfig.c	Wed Sep 03 15:38:01 2014 +0200
@@ -199,6 +199,10 @@
 	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
 	return 1;
     }
+    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", Config.name)) < 0) {
+	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	return 1;
+    }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "LISTEN_PORT", "%d", Config.my_port)) < 0) {
 	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
@@ -1595,6 +1599,9 @@
 	    }
 	    xmlFree(key);
 	}
+	if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
+	    Config.name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+	}
 	if ((!xmlStrcmp(cur->name, (const xmlChar *)"LISTEN_PORT"))) {
 	    key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
 	    if (sscanf((const char *)key, "%d", &ival) == 1)

mercurial