From: Nishi Date: Thu, 12 Sep 2024 22:19:34 +0000 (+0000) Subject: fixed socket issue X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=c6ce0973cb3be973a9d7c55ac087ab73efb6a3b0;p=okuu.git fixed socket issue git-svn-id: file:///raid/svn-personal/okuu/trunk@14 7d206d2a-66c2-044b-96de-ba755a9b3ba8 --- 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;