# HG changeset patch # User Michiel Broek # Date 1406877938 -7200 # Node ID c31ea86fec438ae1d79c42132fc4181aa21cdf3b # Parent e97829d0f8f96354a45a2137dcf43baa41c43e92 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration. diff -r e97829d0f8f9 -r c31ea86fec43 thermferm/devices.c --- a/thermferm/devices.c Thu Jul 31 23:57:04 2014 +0200 +++ b/thermferm/devices.c Fri Aug 01 09:25:38 2014 +0200 @@ -116,6 +116,7 @@ } } } + closedir(fd); } #ifdef HAVE_WIRINGPI_H @@ -250,6 +251,7 @@ syslog(LOG_NOTICE, "sensor %s CRC error", device->address); device->present = DEVPRESENT_ERROR; } + fclose(fp); } else { if (device->present != DEVPRESENT_NO) { syslog(LOG_NOTICE, "sensor %s is missing", device->address); diff -r e97829d0f8f9 -r c31ea86fec43 thermferm/rdconfig.c --- a/thermferm/rdconfig.c Thu Jul 31 23:57:04 2014 +0200 +++ b/thermferm/rdconfig.c Fri Aug 01 09:25:38 2014 +0200 @@ -114,7 +114,8 @@ -int wrconfig(void) +int do_wrconfig(void); +int do_wrconfig(void) { int rc = 0; FILE *fp; @@ -563,6 +564,17 @@ fclose(fp); xmlBufferFree(buf); + return 0; +} + + + +int wrconfig(void) +{ + int rc; + + rc = do_wrconfig(); + syslog(LOG_NOTICE, "Rewritten configuration, rc=%d", rc); return rc; }