-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.c
30 lines (28 loc) · 1.36 KB
/
error.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: afenzl <afenzl@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/12 20:40:04 by afenzl #+# #+# */
/* Updated: 2022/06/14 23:44:31 by afenzl ### ########.fr */
/* */
/* ************************************************************************** */
#include "pipex.h"
void ft_error(int errorcode)
{
if (errorcode == 0)
perror("Error:\n not the right amount of arguments\n");
else if (errorcode == 1)
perror("Error:\n could not open pipe\n");
else if (errorcode == 2)
perror("Error:\ncould not fork the process\n");
else if (errorcode == 3)
perror("Error:\ncommand not found\n");
else if (errorcode == 4)
perror("Error:\nsecond command not found\n");
else if (errorcode == 5)
perror("Error:\ncould not open given file\n");
exit(0);
}