diff -r a84792cab21c -r dda91dfa4aa8 thermferm/rdconfig.c --- a/thermferm/rdconfig.c Mon Aug 25 21:33:57 2014 +0200 +++ b/thermferm/rdconfig.c Tue Aug 26 13:50:35 2014 +0200 @@ -153,7 +153,7 @@ * Create a new XML buffer, to which the XML document will be written */ if ((buf = xmlBufferCreate()) == NULL) { - syslog(LOG_WARNING, "wrconfig: error creating the xml buffer"); + syslog(LOG_NOTICE, "wrconfig: error creating the xml buffer"); return 1; } @@ -161,7 +161,7 @@ * Create a new XmlWriter for memory, with no compression. */ if ((writer = xmlNewTextWriterMemory(buf, 0)) == NULL) { - syslog(LOG_WARNING, "wrconfig: error creating the xml writer"); + syslog(LOG_NOTICE, "wrconfig: error creating the xml writer"); return 1; } @@ -169,7 +169,7 @@ * Use indentation instead of one long line */ if ((rc = xmlTextWriterSetIndent(writer, 2)) < 0) { - syslog(LOG_WARNING, "wrconfig: error setting Indent"); + syslog(LOG_NOTICE, "wrconfig: error setting Indent"); return 1; } @@ -179,7 +179,7 @@ * declaration. */ if ((rc = xmlTextWriterStartDocument(writer, NULL, MY_ENCODING, NULL)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartDocument"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartDocument"); return 1; } @@ -188,7 +188,7 @@ * element, this will be the root element of the document. */ if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "THERMFERM")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } @@ -196,39 +196,39 @@ * Add an attribute with name "VERSION" and value "1" to THERMFERM. */ if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "LISTEN_PORT", "%d", Config.my_port)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMPFORMAT", "%c", Config.tempFormat)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_ADDRESS", "%s", Config.temp_address)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_STATE", "%d", Config.temp_state)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_VALUE", "%d", Config.temp_value)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_ADDRESS", "%s", Config.hum_address)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_STATE", "%d", Config.hum_state)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_VALUE", "%d", Config.hum_value)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } @@ -237,7 +237,7 @@ * Start an element named "LCDS" as child of THERMFERM. */ if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "LCDS")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } /* @@ -245,37 +245,37 @@ * However this program doesn't use more then one yet. */ if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "LCD")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ADDRESS", "0x%x", Config.lcd_address)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COLUMNS", "%d", Config.lcd_cols)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROWS", "%d", Config.lcd_rows)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } /* * Close the element named LCD. */ if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } /* * Close the element LCDS. */ if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } #endif @@ -285,7 +285,7 @@ */ if (Config.units) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "FERMENTERS")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } for (tmp3 = Config.units; tmp3; tmp3 = tmp3->next) { @@ -294,146 +294,146 @@ * are written to a state file. */ if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "UNIT")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", tmp3->uuid)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", tmp3->name)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VOLUME", "%.1f", tmp3->volume)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (tmp3->air_address) { if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_ADDRESS", "%s", tmp3->air_address)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_STATE", "%d", tmp3->air_state)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_TEMPERATURE", "%d", tmp3->air_temperature)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } } if (tmp3->beer_address) { if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_ADDRESS", "%s", tmp3->beer_address)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_STATE", "%d", tmp3->beer_state)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_TEMPERATURE", "%d", tmp3->beer_temperature)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } } if (tmp3->heater_address) { if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_ADDRESS", "%s", tmp3->heater_address)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_STATE", "%d", tmp3->heater_state)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } } if (tmp3->cooler_address) { if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_ADDRESS", "%s", tmp3->cooler_address)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_STATE", "%d", tmp3->cooler_state)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } } if (tmp3->fan_address) { if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_ADDRESS", "%s", tmp3->fan_address)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_STATE", "%d", tmp3->fan_state)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } } if (tmp3->door_address) { if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_ADDRESS", "%s", tmp3->door_address)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_STATE", "%d", tmp3->door_state)) < 0)) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "MODE", "%s", UNITMODE[tmp3->mode] )) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_SET", "%.1f", tmp3->beer_set)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "FRIDGE_SET", "%.1f", tmp3->fridge_set)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_SET_MIN", "%.1f", tmp3->temp_set_min)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_SET_MAX", "%.1f", tmp3->temp_set_max)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "IDLE_RANGE_L", "%.1f", tmp3->idle_rangeL)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "IDLE_RANGE_H", "%.1f", tmp3->idle_rangeH)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (tmp3->profile) { if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE", "%s", tmp3->profile)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STARTED", "%d", (unsigned int)tmp3->prof_started)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_PAUSED", "%d", (unsigned int)tmp3->prof_paused)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STATE", "%s", PROFSTATE[tmp3->prof_state] )) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } @@ -443,84 +443,84 @@ */ if (Config.profiles) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "PROFILES")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } for (tmp4 = Config.profiles; tmp4; tmp4 = tmp4->next) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "PROFILE")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", tmp4->uuid)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", tmp4->name)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BUSY", "%d", tmp4->busy)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "INITTEMP", "%.1f", tmp4->inittemp)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if (tmp4->steps) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "STEPS")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } for (tmp5 = tmp4->steps; tmp5; tmp5 = tmp5->next) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "STEP")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "RESTTIME", "%d", tmp5->resttime)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "STEPTIME", "%d", tmp5->steptime)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TARGET", "%.1f", tmp5->target)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } if (Config.devices) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "DEVICES")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } #ifdef HAVE_WIRINGPI_H @@ -528,67 +528,67 @@ #endif for (device = Config.devices; device; device = device->next) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "DEVICE")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VERSION", "%d", device->version)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", device->uuid)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TYPE", "%s", DEVTYPE[device->type])) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DIRECTION", "%s", DEVDIR[device->direction])) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VALUE", "%d", device->value)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "OFFSET", "%d", device->offset)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRESENT", "%s", DEVPRESENT[device->present])) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ADDRESS", "%s", device->address)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "SUBDEVICE", "%d", device->subdevice)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "GPIOPIN", "%d", device->gpiopin)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DESCRIPTION", "%s", device->description)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "INUSE", "%d", device->inuse)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COMMENT", "%s", device->comment)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TIMESTAMP", "%d", (int)device->timestamp)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } @@ -597,7 +597,7 @@ #endif if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } @@ -605,113 +605,113 @@ #ifdef USE_SIMULATOR if (Config.simulators) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "SIMULATORS")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } for (simulator = Config.simulators; simulator; simulator = simulator->next) { if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "SIMULATOR")) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VERSION", "%d", simulator->version)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", simulator->uuid)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", simulator->name)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VOLUME_AIR", "%d", simulator->volume_air)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VOLUME_BEER", "%d", simulator->volume_beer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROOM_TEMPERATURE", "%.1f", simulator->room_temperature)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_TEMPERATURE", "%f", simulator->air_temperature)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_TEMPERATURE", "%f", simulator->beer_temperature)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_TEMP", "%f", simulator->cooler_temp)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_TIME", "%d", simulator->cooler_time)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_SIZE", "%.3f", simulator->cooler_size)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_TEMP", "%f", simulator->heater_temp)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_TIME", "%d", simulator->heater_time)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_SIZE", "%.3f", simulator->heater_size)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_STATE", "%d", simulator->heater_state)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_STATE", "%d", simulator->cooler_state)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "FRIGO_ISOLATION", "%.3f", simulator->frigo_isolation)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_YEAST_HEAT", "%f", simulator->s_yeast_heat)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_YEAST_STARTED", "%d", (int)simulator->s_yeast_started)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_COOL_TEMP", "%f", simulator->s_cool_temp)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_HEAT_TEMP", "%f", simulator->s_heat_temp)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_COOL_CHANGED", "%d", (int)simulator->s_cool_changed)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_HEAT_CHANGED", "%d", (int)simulator->s_heat_changed)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); return 1; } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } if ((rc = xmlTextWriterEndElement(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); return 1; } } @@ -721,7 +721,7 @@ * All done, close any open elements */ if ((rc = xmlTextWriterEndDocument(writer)) < 0) { - syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndDocument"); + syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndDocument"); return 1; } xmlFreeTextWriter(writer); @@ -742,7 +742,7 @@ fprintf(stdout, "Writing %s\n", mypath); if ((fp = fopen(mypath, "w")) == NULL) { - syslog(LOG_WARNING, "could not rewrite %s", mypath); + syslog(LOG_NOTICE, "could not rewrite %s", mypath); return 1; } @@ -760,7 +760,7 @@ int rc; rc = do_wrconfig(); - syslog(LOG_WARNING, "Rewritten configuration, rc=%d", rc); + syslog(LOG_NOTICE, "Rewritten configuration, rc=%d", rc); return rc; } @@ -1504,7 +1504,7 @@ xmlChar *key; killconfig(); - syslog(LOG_WARNING, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME"))); + syslog(LOG_NOTICE, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME"))); /* * Search config file @@ -1530,20 +1530,20 @@ free(mypath); mypath = xstrcpy((char *)"/usr/local/etc/mbsepi-apps/thermferm.xml"); if ((doc = xmlParseFile(mypath)) == NULL) { - syslog(LOG_WARNING, "rdconfig: could not find thermferm.xml"); + syslog(LOG_NOTICE, "rdconfig: could not find thermferm.xml"); return 1; } } } - syslog(LOG_WARNING, "rdconfig: using %s", mypath); + syslog(LOG_NOTICE, "rdconfig: using %s", mypath); if ((cur = xmlDocGetRootElement(doc)) == NULL) { - syslog(LOG_WARNING, "XML file %s empty.", mypath); + syslog(LOG_NOTICE, "XML file %s empty.", mypath); xmlFreeDoc(doc); return 1; } if (xmlStrcmp(cur->name, (const xmlChar*)"THERMFERM")) { - syslog(LOG_WARNING, "XML file %s is not a valid configuration file.", mypath); + syslog(LOG_NOTICE, "XML file %s is not a valid configuration file.", mypath); xmlFreeDoc(doc); return 1; } @@ -1557,7 +1557,7 @@ key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); if (xmlStrcmp(key, (const xmlChar *)"1")) { xmlFree(key); - syslog(LOG_WARNING, "XML file %s is not a valid version", mypath); + syslog(LOG_NOTICE, "XML file %s is not a valid version", mypath); return 1; } xmlFree(key);