Exemplo n.º 1
0
/*
 * quit_response: Used by irc_io when called from irc_quit to see if we got
 * the right response to our question.  If the response was affirmative, the
 * user gets booted from irc.  Otherwise, life goes on. 
 */
static	void quit_response(char *dummy, char *ptr)
{
	int	len;

	if ((len = strlen(ptr)) != 0)
		if (!my_strnicmp(ptr, "yes", len))
			irc_exit(1, NULL, "IRC][ %s:  Rest in peace", irc_version);
}
Exemplo n.º 2
0
/* sig_int: if somehow everything else freezes up, hitting ctrl-c
 *          five times should kill the program.  */
static RETSIGTYPE sig_int(int sig)
{
    OLD_HANDLER(old_sigint, sig);

    if (cntl_c_hit++ >= 4)
	irc_exit("User abort with 5 Ctrl-C's", NULL);
    else if (cntl_c_hit > 1)
	kill(getpid(), SIGALRM);
}
Exemplo n.º 3
0
/* sig_coredump: handle segfaults in a nice way */
static RETSIGTYPE sig_coredump(int sig)
{
    static volatile int segv_recurse = 0;

    const char message[] =
	"\n\n\r\nXaric has been terminated by a signal\n\n"
	"If this is a bug in Xaric, please send an email to\n"
	"<*****@*****.**> with as much detail as possible about\n"
	"what you did to trigger the bug. Make sure to include\n"
	"the version of Xaric you are using, and the type of system\n" "in your report.\n\n\n\r";

    if (segv_recurse++)
	_exit(1);

    write(STDERR_FILENO, message, sizeof(message));

    OLD_HANDLER(old_segv, sig);

    irc_exit("Wow! A bug?", NULL);
}
Exemplo n.º 4
0
/* sig_quit_irc: cleans up and leaves */
static RETSIGTYPE sig_quit_irc(int unused)
{
    irc_exit(get_string_var(SIGNOFF_REASON_VAR), NULL);
}