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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Greear <greearb@xxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxx>
---
 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


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux