/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* error.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/23 15:51:56 by mcolonna #+# #+# */ /* Updated: 2024/04/30 15:01:27 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ #include "include.h" void minishell_error(const char *msg) { if (str_eq(msg, "errno")) perror("minishell"); else { print_str(err_remember, 2, "minishell: "); print_line(err_remember, 2, msg); err_get(); } } void fatal_error(const char *msg) { (void)msg; minishell_error("errno"); mem_freeall(g_mc); exit(errno); } void fatal_error_msg(const char *msg) { minishell_error(msg); mem_freeall(g_mc); exit(errno); }