srcs files moved

This commit is contained in:
LuckyLaszlo
2021-12-16 03:37:34 +01:00
parent 5a0a237aaa
commit f53969cd45
12 changed files with 11 additions and 7 deletions

View File

@@ -0,0 +1,45 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error_wrappers.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/01 17:16:30 by lperrey #+# #+# */
/* Updated: 2021/12/05 16:26:48 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int shell_error(char *s1, char *s2, char *s3, int ret_val)
{
char *prefix;
prefix = "minishell: ";
write(STDERR_FILENO, prefix, ft_strlen(prefix));
if (s1)
write(STDERR_FILENO, s1, ft_strlen(s1));
if (s2)
write(STDERR_FILENO, s2, ft_strlen(s2));
if (s3)
write(STDERR_FILENO, s3, ft_strlen(s3));
write(STDERR_FILENO, "\n", 1);
return (ret_val);
}
int shell_perror(char *s1, char *s2, char *s3, int ret_val)
{
char *prefix;
prefix = "minishell: ";
write(STDERR_FILENO, prefix, ft_strlen(prefix));
if (s1)
write(STDERR_FILENO, s1, ft_strlen(s1));
if (s2)
write(STDERR_FILENO, s2, ft_strlen(s2));
if (s3)
write(STDERR_FILENO, s3, ft_strlen(s3));
perror(NULL);
return (ret_val);
}