thermferm/thermferm.c

changeset 235
885ad8d52126
parent 234
b69438db19ec
child 238
a0f1deb65889
--- a/thermferm/thermferm.c	Wed Aug 13 21:21:55 2014 +0200
+++ b/thermferm/thermferm.c	Wed Aug 13 21:41:10 2014 +0200
@@ -236,7 +236,7 @@
 
     if (rdconfig()) {
 	fprintf(stderr, "Error reading configuration\n");
-	syslog(LOG_NOTICE, "halted");
+	syslog(LOG_WARNING, "Error reading configuration: halted");
 	return 1;
     }
 
@@ -276,14 +276,13 @@
 	 * associated with that terminal as its control terminal.
 	 */
 	if ((pgrp = setpgid(0, 0)) == -1) {
-	    syslog(LOG_NOTICE, "setpgpid failed");
+	    syslog(LOG_WARNING, "setpgpid failed");
 	}
 
 	frk = fork();
 	switch (frk) {
 	    case -1:	
-		    	syslog(LOG_NOTICE, "Daemon fork failed: %s", strerror(errno));
-			syslog(LOG_NOTICE, "Finished, rc=1");
+		    	syslog(LOG_WARNING, "Daemon fork failed: %s", strerror(errno));
 #ifdef HAVE_WIRINGPI_H
 			stopLCD();
 #endif
@@ -293,17 +292,17 @@
 			 */
 			fclose(stdin);
 			if (open("/dev/null", O_RDONLY) != 0) {
-			    syslog(LOG_NOTICE, "Reopen of stdin to /dev/null failed");
+			    syslog(LOG_WARNING, "Reopen of stdin to /dev/null failed");
 			    _exit(2);
 			}
 			fclose(stdout);
 			if (open("/dev/null", O_WRONLY | O_APPEND | O_CREAT,0600) != 1) {
-			    syslog(LOG_NOTICE, "Reopen of stdout to /dev/null failed");
+			    syslog(LOG_WARNING, "Reopen of stdout to /dev/null failed");
 			    _exit(2);
 			}
 			fclose(stderr);
 			if (open("/dev/null", O_WRONLY | O_APPEND | O_CREAT,0600) != 2) {
-			    syslog(LOG_NOTICE, "Reopen of stderr to /dev/null failed");
+			    syslog(LOG_WARNING, "Reopen of stderr to /dev/null failed");
 			    _exit(2);
 			}
 			mypid = getpid();
@@ -346,7 +345,7 @@
     float		previous_target;
 
     if (lockprog((char *)"thermferm")) {
-	syslog(LOG_NOTICE, "Can't lock");
+	syslog(LOG_WARNING, "Can't lock");
 	return 1;
     }
 
@@ -363,7 +362,7 @@
 #endif
     if (rc) {
 	fprintf(stderr, "my_devices_loop thread didn't start rc=%d\n", rc);
-	syslog(LOG_NOTICE, "my_devices_loop thread didn't start rc=%d", rc);
+	syslog(LOG_WARNING, "my_devices_loop thread didn't start rc=%d", rc);
 #ifndef HAVE_WIRINGPI_H
     } else {
 	t++;
@@ -377,7 +376,7 @@
 #endif
     if (rc) {
 	fprintf(stderr, "my_server_loop thread didn't start rc=%d\n", rc);
-	syslog(LOG_NOTICE, "my_server_loop thread didn't start rc=%d", rc);
+	syslog(LOG_WARNING, "my_server_loop thread didn't start rc=%d", rc);
 #ifndef HAVE_WIRINGPI_H
     } else {
 	t++;
@@ -388,7 +387,7 @@
     rc = piThreadCreate(my_panel_loop);
     if (rc) {
 	fprintf(stderr, "my_panel_loop thread didn't start rc=%d\n", rc);
-	syslog(LOG_NOTICE, "my_panel_loop thread didn't start rc=%d", rc);
+	syslog(LOG_WARNING, "my_panel_loop thread didn't start rc=%d", rc);
     }
 #endif
 

mercurial