thermferm/rdconfig.c

changeset 240
6bdda35b4a13
parent 235
885ad8d52126
child 245
b01b6238eb67
--- a/thermferm/rdconfig.c	Thu Aug 14 22:02:33 2014 +0200
+++ b/thermferm/rdconfig.c	Thu Aug 14 22:43:41 2014 +0200
@@ -507,6 +507,9 @@
 	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 	    return 1;
 	}
+#ifdef HAVE_WIRINGPI_H
+	piLock(LOCK_DEVICES);
+#endif
 	for (device = Config.devices; device; device = device->next) {
 	    if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "DEVICE")) < 0) {
 		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
@@ -573,6 +576,9 @@
 		return 1;
 	    }
 	}
+#ifdef HAVE_WIRINGPI_H
+	piUnlock(LOCK_DEVICES);
+#endif
 
 	if ((rc = xmlTextWriterEndElement(writer)) < 0) {
 	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");

mercurial