-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipex_error.c
24 lines (22 loc) · 1.15 KB
/
pipex_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pipex_error.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cgodecke <cgodecke@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/22 13:19:16 by cgodecke #+# #+# */
/* Updated: 2023/04/05 10:56:08 by cgodecke ### ########.fr */
/* */
/* ************************************************************************** */
#include "pipex.h"
void pipex_error(int shall_exit, char *message,
int isstrerror, int exit_code)
{
if (isstrerror == 1)
of_fd_printf(2, "pipex: %s %s\n", message, strerror(exit_code));
else
of_fd_printf(2, "pipex: %s\n", message);
if (shall_exit == 1)
exit(exit_code);
}