[PATCH] wpa_cli: Don't buffer stdout.

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

 



From: Ben Greear <greearb@xxxxxxxxxxxxxxx>

I am trying to read from a wpa_cli process using a perl script,
and it appears that wpa_cli was buffering output and so my script
would not see events properly.  This patch apepars to fix it.

Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx>
---
 wpa_supplicant/wpa_cli.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 4cdc4fb..510f385 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -4410,6 +4410,11 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	/* Don't buffer stdout, we need to see events immediately as they
+	 * happen.
+	 */
+	setbuf(stdout, NULL);
+
 	interactive = (argc == optind) && (action_file == NULL);
 
 	if (interactive)
-- 
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