forked from Kinnune/minishell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
40 lines (37 loc) · 1.36 KB
/
main.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main_ekinnune.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ekinnune <ekinnune@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/08 11:10:42 by ekinnune #+# #+# */
/* Updated: 2023/07/18 14:07:45 by ekinnune ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int main(int argc, char **argv, char **envp)
{
int i;
struct sigaction sa;
t_command *command;
t_token *token;
i = argc;
sa.sa_flags = SA_SIGINFO;
sa.sa_flags = SA_RESTART;
token = NULL;
command = NULL;
if (argv[1] == NULL)
{
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGINT);
g_data.flag = 0;
g_data.flag1 = 0;
sigaction(SIGINT, &sa, NULL);
copy_env(envp);
while (1)
i = start_main(token, command);
return (i);
}
return (0);
}