[PATCH] wpa-cli: Don't start edit_mode if Daemonize mode is enabled.

greearb at candelatech.com greearb at candelatech.com
Tue Jun 13 17:51:25 PDT 2017


From: Ben Greear <greearb at candelatech.com>

Daemonize disconnects stdin, so there is nothing to read and
the eloop (often?) causes disconnect due to read of end-of-pipe
from stdin.

So, don't start edit mode in that case.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 wpa_supplicant/wpa_cli.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 510f385..34812c1 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -4207,7 +4207,10 @@ static void try_connection(void *eloop_ctx, void *timeout_ctx)
 		printf("Connection established.\n");
 
 done:
-	start_edit();
+	if (pid_file) /* daemonize mode, don't want edit-mode enabled since STDIN is not available */
+		eloop_register_timeout(ping_interval, 0, wpa_cli_ping, NULL, NULL);
+	else
+		start_edit();
 }
 
 
-- 
2.7.5




More information about the Hostap mailing list