From f6e474d27a1398c6d4f2e88c7f2d3797b85217da Mon Sep 17 00:00:00 2001 From: Christopher Uhlig Date: Wed, 22 Jan 2025 02:40:27 +0100 Subject: kinda fix for pipe error and again.vs for you db just chnage workfolder gn --- src/error.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/error.c (limited to 'src/error.c') diff --git a/src/error.c b/src/error.c new file mode 100644 index 0000000..2ca60b2 --- /dev/null +++ b/src/error.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* error.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: dkaiser + +void *error(int err_code, char *err_text, int exit_code, int *ret_code) +{ + errno = err_code; + perror(err_text); + if (ret_code != NULL) + *ret_code = exit_code; + return (NULL); +} + +void command_not_found_error(char *cmd) +{ + ft_printf("%s:", cmd); + ft_putstr_fd(" command not found", 2); + ft_printf("\n"); +} -- cgit v1.2.3