]> Nishi Git Mirror - okuu.git/commitdiff
fixed socket issue
authorNishi <nishi@nishi.boats>
Thu, 12 Sep 2024 22:19:34 +0000 (22:19 +0000)
committerNishi <nishi@nishi.boats>
Thu, 12 Sep 2024 22:19:34 +0000 (22:19 +0000)
git-svn-id: file:///raid/svn-personal/okuu/trunk@14 7d206d2a-66c2-044b-96de-ba755a9b3ba8

Bot/bot.c

index 51cc9f158e51883bda25efc920f14a48e128f302..55dd11e5fdd8d8116975c285886b0b0f01bbf089 100644 (file)
--- 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;