[NetworkManager-openconnect/master: 1/3] Don't wait for closed STDIN in wait_for_quit
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [NetworkManager-openconnect/master: 1/3] Don't wait for closed STDIN in wait_for_quit
- Date: Sun, 24 Apr 2022 09:28:44 +0000 (UTC)
commit 91b56c6ed93794b8331c1fc5aa8248b92bfd7de8
Author: Stefan Bühler <stefan buehler tik uni-stuttgart de>
Date: Fri Feb 18 13:37:38 2022 +0100
Don't wait for closed STDIN in wait_for_quit
nm_vpn_service_plugin_read_vpn_details in recent NetworkManager versions
clears stdin due to buffering; waiting for QUIT in the stream doesn't
work anymore.
EOF should be safe to accept as "QUIT" signal though.
auth-dialog/main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index e0d8544..0d8ceee 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -1744,7 +1744,9 @@ static void wait_for_quit (void)
do {
errno = 0;
n = read (0, &c, 1);
- if (n == 0 || (n < 0 && errno == EAGAIN))
+ if (n == 0)
+ break;
+ if (n < 0 && errno == EAGAIN)
g_usleep (G_USEC_PER_SEC / 10);
else if (n == 1) {
g_string_append_c (str, c);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]