aboutsummaryrefslogtreecommitdiff
path: root/src/kike.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kike.c')
-rw-r--r--src/kike.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/kike.c b/src/kike.c
index 5bcab42..974f80f 100644
--- a/src/kike.c
+++ b/src/kike.c
@@ -65,10 +65,7 @@ static void
setup_signal_handlers (void)
{
if (pipe (g_signal_pipe) == -1)
- {
- print_fatal ("pipe: %s", strerror (errno));
- exit (EXIT_FAILURE);
- }
+ exit_fatal ("%s: %s", "pipe", strerror (errno));
set_cloexec (g_signal_pipe[0]);
set_cloexec (g_signal_pipe[1]);
@@ -87,10 +84,7 @@ setup_signal_handlers (void)
sa.sa_handler = sigterm_handler;
if (sigaction (SIGINT, &sa, NULL) == -1
|| sigaction (SIGTERM, &sa, NULL) == -1)
- {
- print_error ("sigaction: %s", strerror (errno));
- exit (EXIT_FAILURE);
- }
+ exit_fatal ("%s: %s", "sigaction", strerror (errno));
}
// --- IRC token validation ----------------------------------------------------
@@ -1011,10 +1005,8 @@ on_irc_client_available (const struct pollfd *pfd, void *user_data)
// TODO: handle resource exhaustion (EMFILE, ENFILE) specially
// (stop accepting new connections and wait until we close some).
- print_fatal ("%s: %s", "accept", strerror (errno));
-
// FIXME: handle this better, bring the server down cleanly.
- exit (EXIT_FAILURE);
+ exit_fatal ("%s: %s", "accept", strerror (errno));
}
char host[NI_MAXHOST] = "unknown", port[NI_MAXSERV] = "unknown";
@@ -1363,7 +1355,7 @@ main (int argc, char *argv[])
call_write_default_config (optarg, g_config_table);
exit (EXIT_SUCCESS);
default:
- print_fatal ("error in options");
+ print_error ("wrong options");
exit (EXIT_FAILURE);
}
}
@@ -1384,7 +1376,7 @@ main (int argc, char *argv[])
struct error *e = NULL;
if (!read_config_file (&ctx.config, &e))
{
- print_fatal ("error loading configuration: %s", e->message);
+ print_error ("error loading configuration: %s", e->message);
error_free (e);
exit (EXIT_FAILURE);
}