Subversion Repositories Okuu

Rev

Rev 11 | Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 12
Line 1... Line 1...
1
/* $Id: bot.c 11 2024-09-11 10:24:20Z nishi $ */
1
/* $Id: bot.c 12 2024-09-11 16:08:33Z nishi $ */
2
 
2
 
3
#include "ok_bot.h"
3
#include "ok_bot.h"
4
 
4
 
5
#include "ok_util.h"
5
#include "ok_util.h"
6
#include "ok_news.h"
6
#include "ok_news.h"
Line 40... Line 40...
40
extern int ircport;
40
extern int ircport;
41
 
41
 
42
int ok_sock;
42
int ok_sock;
43
struct sockaddr_in ok_addr;
43
struct sockaddr_in ok_addr;
44
 
44
 
45
void ok_close(int sock) { close(sock); }
45
void ok_close(int sock) { shutdown(sock, SHUT_RDWR);close(sock); }
46
 
46
 
47
void ok_bot_kill(int sig) {
47
void ok_bot_kill(int sig) {
48
	fprintf(stderr, "Shutdown\n");
48
	fprintf(stderr, "Shutdown\n");
49
	ircfw_socket_send_cmd(ok_sock, NULL, "QUIT :Shutdown (Signal)");
49
	ircfw_socket_send_cmd(ok_sock, NULL, "QUIT :Shutdown (Signal)");
50
	exit(1);
50
	exit(1);