diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-22 10:19:03 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-22 10:19:03 +0100 |
commit | 57c4fc067a4a43cebee74e9d6076eb538986d5cc (patch) | |
tree | 96d4e5cb313825c10409a0debebbfe129fa800bf | |
parent | 54879ab3b2cbcaf1c9114bddd85ec5d4dc097915 (diff) | |
parent | 87de505f3203054a2a0becbea5a064d24ab2cde3 (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.c | 6 | ||||
-rw-r--r-- | ipc.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -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]; @@ -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 ) |