diff options
Diffstat (limited to 'news/knews/patches')
-rw-r--r-- | news/knews/patches/patch-ai | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/news/knews/patches/patch-ai b/news/knews/patches/patch-ai index ea5f798cea7..af1e2e71b40 100644 --- a/news/knews/patches/patch-ai +++ b/news/knews/patches/patch-ai @@ -1,7 +1,7 @@ -$NetBSD: patch-ai,v 1.2 2001/02/24 22:40:40 tron Exp $ +$NetBSD: patch-ai,v 1.3 2001/02/25 11:10:13 tron Exp $ --- src/server.c.orig Fri Jan 9 18:16:22 1998 -+++ src/server.c Sat Feb 24 23:24:45 2001 ++++ src/server.c Sun Feb 25 12:07:35 2001 @@ -2,19 +2,21 @@ * Copyright (C) 1995, 1996 Karl-Johan Johnsson. */ @@ -26,7 +26,7 @@ $NetBSD: patch-ai,v 1.2 2001/02/24 22:40:40 tron Exp $ struct SERVER { int fd; char *buffer; -@@ -128,30 +130,35 @@ +@@ -128,30 +130,39 @@ * tell != 0 means tell about errors * tell > 1 means say what you're doing */ @@ -41,12 +41,22 @@ $NetBSD: patch-ai,v 1.2 2001/02/24 22:40:40 tron Exp $ - set_message("Error: Failed to create socket!", True); - return -1; - } -- ++ while (addr) { ++ server_close(server); ++ server->fd = open_socket(addr); ++ if (server->fd < 0) { ++ set_message("Error: Failed to create socket!", True); ++ return -1; ++ } + - if (tell > 1) - set_message("Server contacted, waiting for response...", False); -- ++ if (tell > 1) ++ set_message("Server contacted, waiting for response...", False); + - tmp = connect_socket(server->fd, addr); -- ++ tmp = connect_socket(server->fd, addr); + - if (tmp < 0 && would_block(server->fd, errno)) { - if (tell == 0) - return 0; /* don't block */ @@ -54,19 +64,7 @@ $NetBSD: patch-ai,v 1.2 2001/02/24 22:40:40 tron Exp $ - tmp = 0; - do_wait(&server->fd, True, server->quit_func, server); - if (server->fd < 0) -+ while (addr) { -+ server_close(server); -+ server->fd = open_socket(addr); -+ if (server->fd < 0) { -+ set_message("Error: Failed to create socket!", True); - return -1; -+ } -+ -+ if (tell > 1) -+ set_message("Server contacted, waiting for response...", False); -+ -+ tmp = connect_socket(server->fd, addr); -+ +- return -1; + if (tmp < 0 && would_block(server->fd, errno)) { + if (tell == 0) + return 0; /* don't block */ @@ -75,10 +73,14 @@ $NetBSD: patch-ai,v 1.2 2001/02/24 22:40:40 tron Exp $ + do_wait(&server->fd, True, server->quit_func, server); + if (server->fd >= 0) + break; -+ + } + + addr = next_addr(addr); ++ } ++ ++ if (!addr) { ++ server_close(server); ++ return -1; } server->buffer[0] = '\0'; |