-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsys_errors2.c
49 lines (43 loc) · 1.41 KB
/
sys_errors2.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* sys_errors2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: irychkov <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/02 22:03:32 by irychkov #+# #+# */
/* Updated: 2024/09/29 17:26:39 by irychkov ### ########.fr */
/* */
/* ************************************************************************** */
#include "pipex.h"
void error_strjoin(t_pipex *fds, int flag, char *cmd)
{
if (flag)
free(cmd);
write(2, "strjoin failed\n", 15);
free_pipex(fds);
exit(1);
}
void error_open(t_pipex *fds)
{
write(2, "open failed\n", 12);
remove_errorfiles(fds);
free_pipex(fds);
exit(1);
}
void error_pipe(void)
{
write(2, "pipe failed\n", 12);
exit(1);
}
void error_unlink(void)
{
write(2, "unlink failed\n", 14);
}
void error_err_filename(t_pipex *fds)
{
write(2, "error filename failed\n", 22);
remove_errorfiles(fds);
free_pipex(fds);
exit(1);
}