aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-01-22 10:19:03 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2006-01-22 10:19:03 +0100
commit57c4fc067a4a43cebee74e9d6076eb538986d5cc (patch)
tree96d4e5cb313825c10409a0debebbfe129fa800bf
parent54879ab3b2cbcaf1c9114bddd85ec5d4dc097915 (diff)
parent87de505f3203054a2a0becbea5a064d24ab2cde3 (diff)
Error checking for accept(). Have to find out why it went wrong (and fork()ed a bit too much) last night.
-rw-r--r--bitlbee.c6
-rw-r--r--ipc.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/bitlbee.c b/bitlbee.c
index 64220914..5da5d6e1 100644
--- a/bitlbee.c
+++ b/bitlbee.c
@@ -238,6 +238,12 @@ gboolean bitlbee_io_new_client( GIOChannel *source, GIOCondition condition, gpoi
int new_socket = accept( global.listen_socket, (struct sockaddr *) &conn_info, &size );
pid_t client_pid = 0;
+ if( new_socket == -1 )
+ {
+ log_message( LOGLVL_WARNING, "Could not accept new connection: %s", strerror( errno ) );
+ return TRUE;
+ }
+
if( global.conf->runmode == RUNMODE_FORKDAEMON )
{
int fds[2];
diff --git a/ipc.c b/ipc.c
index 0fb56099..778f74c8 100644
--- a/ipc.c
+++ b/ipc.c
@@ -104,7 +104,7 @@ static const command_t ipc_master_commands[] = {
static void ipc_child_cmd_die( irc_t *irc, char **cmd )
{
- irc_abort( irc, 1, "Shutdown requested by operator" );
+ irc_abort( irc, 0, "Shutdown requested by operator" );
}
static void ipc_child_cmd_wallops( irc_t *irc, char **cmd )