From c6ce0973cb3be973a9d7c55ac087ab73efb6a3b0 Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 12 Sep 2024 22:19:34 +0000 Subject: [PATCH] fixed socket issue git-svn-id: file:///raid/svn-personal/okuu/trunk@14 7d206d2a-66c2-044b-96de-ba755a9b3ba8 --- Bot/bot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Bot/bot.c b/Bot/bot.c index 51cc9f1..55dd11e 100644 --- a/Bot/bot.c +++ b/Bot/bot.c @@ -44,7 +44,9 @@ int ok_sock; struct sockaddr_in ok_addr; void ok_close(int sock) { + char c; while(close(sock) == 0); + while(recv(sock, &c, 1, 0) > 0); } void ok_bot_kill(int sig) { @@ -247,6 +249,7 @@ void ok_bot(void) { pid_t pid = fork(); int code; if(pid == 0){ + close(ok_sock); _exit(ok_news_write(nick, msg)); }else{ int status; -- 2.43.0