~nloomans/ft_select

22ba947acbea51c3feb6800e85ec927750dd2152 — Noah Loomans 1 year, 8 months ago 61246d5
improve error messages
2 files changed, 9 insertions(+), 3 deletions(-)

M src/error.c
M src/event.c
M src/error.c => src/error.c +1 -1
@@ 12,7 12,7 @@ t_error         errorf(char *fmt, ...)
	va_end(vlist);
    if (ret == -1)
        return ((t_error){
			.msg = "an error occoured during the generation of this errror" });
			.msg = "an error occurred during the generation of this error" });
    return (dest);
}


M src/event.c => src/event.c +8 -2
@@ 113,12 113,18 @@ t_error							event_init(void)
		if (g_event_signal_map[signum].handler)
		{
			if (signal(signum, g_event_signal_map[signum].handler) == SIG_ERR)
				return (errorf("unable to bind signal: %s", strerror(errno)));
			{
				return (errorf("unable to bind signal %d: %s",
					signum, strerror(errno)));
			}
		}
		else if (g_event_signal_map[signum].action)
		{
			if (signal(signum, handle_generic) == SIG_ERR)
				return (errorf("unable to bind signal: %s", strerror(errno)));
			{
				return (errorf("unable to bind signal %d: %s",
					signum, strerror(errno)));
			}
		}
		signum++;
	}