brewco/brewco.c

changeset 459
1f88be70f253
parent 456
045db83dd013
child 464
4a624c071ca9
--- a/brewco/brewco.c	Sat Dec 12 22:17:25 2015 +0100
+++ b/brewco/brewco.c	Tue Dec 15 23:11:42 2015 +0100
@@ -23,6 +23,7 @@
 #include "brewco.h"
 #include "rdconfig.h"
 #include "rdsession.h"
+#include "rdrecipes.h"
 #include "util.h"
 #include "xutil.h"
 #include "lcd-pcf8574.h"
@@ -457,7 +458,7 @@
 		minutes++;
 	    }
 
-fprintf(stdout, "%d seconds %d minutes %ld millis\n", seconds, minutes, millis());
+//fprintf(stdout, "%d seconds %d minutes %ld millis\n", seconds, minutes, millis());
 
 	    rc = device_in(unit->hlt_sensor.uuid, &temp);
 	    if (rc == DEVPRESENT_YES) {
@@ -551,7 +552,9 @@
 	}
 	sock = -1;
     }
+    wrrecipes();
     wrconfig();
+
 //    ulockprog((char *)"brewco");
     return 0;
 }
@@ -595,6 +598,14 @@
     if (debug)
 	fprintf(stdout, "configuration loaded\n");
 
+    if (rdrecipes()) {
+	fprintf(stderr, "Error reading recipes\n");
+    	syslog(LOG_NOTICE, "Error reading recipes: halted");
+	return 1;
+    }
+    if (debug)
+	fprintf(stdout, "recipes loaded\n");
+
     /*
      *  Catch all the signals we can, and ignore the rest. Note that SIGKILL can't be ignored
      *  but that's live. This daemon should only be stopped by SIGTERM.

mercurial