diff svr-main.c @ 1733:d529a52b2f7c coverity coverity

merge coverity from main
author Matt Johnston <matt@ucc.asn.au>
date Fri, 26 Jun 2020 21:07:34 +0800
parents 6ea18ca8fc03
children 2b3a8026a6ce
line wrap: on
line diff
--- a/svr-main.c	Thu Mar 21 23:28:59 2019 +0800
+++ b/svr-main.c	Fri Jun 26 21:07:34 2020 +0800
@@ -80,9 +80,11 @@
 static void main_inetd() {
 	char *host, *port = NULL;
 
-	/* Set up handlers, syslog, seed random */
+	/* Set up handlers, syslog */
 	commonsetup();
 
+	seedrandom();
+
 #if DEBUG_TRACE
 	if (debug_trace) {
 		/* -v output goes to stderr which would get sent over the inetd network socket */
@@ -273,7 +275,7 @@
 				goto out;
 			}
 
-#ifdef DEBUG_NOFORK
+#if DEBUG_NOFORK
 			fork_ret = 0;
 #else
 			fork_ret = fork();
@@ -296,11 +298,6 @@
 			} else {
 
 				/* child */
-#ifdef DEBUG_FORKGPROF
-				extern void _start(void), etext(void);
-				monstartup((u_long)&_start, (u_long)&etext);
-#endif /* DEBUG_FORKGPROF */
-
 				getaddrstring(&remoteaddr, NULL, &remote_port, 0);
 				dropbear_log(LOG_INFO, "Child connection from %s:%s", remote_host, remote_port);
 				m_free(remote_host);
@@ -404,8 +401,6 @@
 	/* Now we can setup the hostkeys - needs to be after logging is on,
 	 * otherwise we might end up blatting error messages to the socket */
 	load_all_hostkeys();
-
-	seedrandom();
 }
 
 /* Set up listening sockets for all the requested ports */