Selaa lähdekoodia

core: main - use fprintf() if daemon_status_send() fails at shut down

- avoid race with syslog() when processes are killed
- reported by GH #1454

(cherry picked from commit 54774017325fe2e24ee7c5d64b343ad0097c8332)
(cherry picked from commit 96d4a01287945a58b3b7c8dfc06bd41acd00d213)
Daniel-Constantin Mierla 7 vuotta sitten
vanhempi
commit
077503d92d
1 muutettua tiedostoa jossa 3 lisäystä ja 4 poistoa
  1. 3 4
      src/main.c

+ 3 - 4
src/main.c

@@ -2630,8 +2630,7 @@ try_again:
 
 	/* fix routing lists */
 	if ( (r=fix_rls())!=0){
-		fprintf(stderr, "ERROR: error %d while trying to fix configuration\n",
-						r);
+		fprintf(stderr, "error %d while trying to fix configuration\n", r);
 		goto error;
 	};
 	fixup_complete=1;
@@ -2647,7 +2646,7 @@ try_again:
 	if (is_main) shutdown_children(SIGTERM, 0);
 	if (!dont_daemonize) {
 		if (daemon_status_send(0) < 0)
-			ERR("error sending exit status: %s [%d]\n",
+			fprintf(stderr, "error sending exit status: %s [%d]\n",
 					strerror(errno), errno);
 	}
 	/* else terminate process */
@@ -2658,7 +2657,7 @@ error:
 	if (is_main) shutdown_children(SIGTERM, 0);
 	if (!dont_daemonize) {
 		if (daemon_status_send((char)-1) < 0)
-			ERR("error sending exit status: %s [%d]\n",
+			fprintf(stderr, "error sending exit status: %s [%d]\n",
 					strerror(errno), errno);
 	}
 	return -1;