-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandle_errors.c
More file actions
67 lines (63 loc) · 1.34 KB
/
Copy pathhandle_errors.c
File metadata and controls
67 lines (63 loc) · 1.34 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "shell.h"
/**
* command_error - Handles command error
* @file_name: File name
* @num_shell_calls: Number of shell call (hsh)
* @command: Command string
*
* Return: Error message
*/
void command_error(char *file_name, int num_shell_calls, char *command)
{
_dprintf(
STDERR_FILENO,
"%s: %d: %s: not found\n",
file_name, num_shell_calls,
command
);
}
/**
* exit_error - Handles exit error
* @file_name: File name
* @num_shell_calls: Number of shell call (hsh)
* @commands: Command string
*
* Return: Error message
*/
void exit_error(char *file_name, int num_shell_calls, char **commands)
{
_dprintf(
STDERR_FILENO,
"%s: %d: %s: Illegal number: %s\n",
file_name, num_shell_calls,
commands[0], commands[1]
);
}
/**
* default_error - Handles error
* @file_name: File name
* @num_shell_calls: Number of shell call (hsh)
* @command: Command string
*
* Return: Error message
*/
void default_error(char *file_name, int num_shell_calls, char *command)
{
(void)file_name;
(void)num_shell_calls;
(void)command;
}
/**
* file_error - Handles file error
* @file_name: File name
* @num_shell_calls: Number of shell call (hsh)
* @command: Command string
*
* Return: Error message
*/
void file_error(char *file_name, int num_shell_calls, char *command)
{
(void)file_name;
(void)num_shell_calls;
(void)command;
}