Compare commits

...

2 Commits

Author SHA1 Message Date
Camille Chauvet
9ab9c06593 Merge remote-tracking branch 'refs/remotes/origin/master' 2023-04-17 10:45:10 +00:00
Camille Chauvet
2f6daa4ce5 fix: signal double prompt 2023-04-17 10:41:54 +00:00
3 changed files with 11 additions and 4 deletions

View File

@ -6,12 +6,14 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/15 14:18:21 by cchauvet #+# #+# */ /* Created: 2023/02/15 14:18:21 by cchauvet #+# #+# */
/* Updated: 2023/04/07 15:17:21 by alouis-j ### ########.fr */ /* Updated: 2023/04/17 10:41:23 by cchauvet ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "cmd.h" #include "cmd.h"
#include "cmd_private.h" #include "cmd_private.h"
#include "../signal/signal.h"
#include <signal.h>
void ft_cmddel(void *ptr) void ft_cmddel(void *ptr)
{ {
@ -56,13 +58,16 @@ void ft_cmdwaiter(void *ptr)
{ {
if (exit_status == 131) if (exit_status == 131)
{ {
ft_printf("Quit (core dumped)\n"); ft_printf("Quit (core dumped)");
*ft_get_exit_code() = 131; *ft_get_exit_code() = 131;
} }
else else
*ft_get_exit_code() = 130; *ft_get_exit_code() = 130;
ft_printf("\n");
} }
else else
*ft_get_exit_code() = WEXITSTATUS(exit_status); *ft_get_exit_code() = WEXITSTATUS(exit_status);
} }
signal(SIGINT, ft_ctrlc);
signal(SIGQUIT, ft_quit);
} }

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/21 12:45:16 by cchauvet #+# #+# */ /* Created: 2023/02/21 12:45:16 by cchauvet #+# #+# */
/* Updated: 2023/04/14 13:04:01 by cchauvet ### ########.fr */ /* Updated: 2023/04/14 17:17:16 by cchauvet ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -58,6 +58,8 @@ static bool ft_executor(t_data *data, t_cmd *cmd, char **env)
execve(cmd->executable, cmd->args, env); execve(cmd->executable, cmd->args, env);
return (1); return (1);
} }
signal(SIGQUIT, SIG_IGN);
signal(SIGINT, SIG_IGN);
return (0); return (0);
} }

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/28 15:59:01 by cchauvet #+# #+# */ /* Created: 2023/03/28 15:59:01 by cchauvet #+# #+# */
/* Updated: 2023/04/11 13:02:34 by cchauvet ### ########.fr */ /* Updated: 2023/04/17 10:39:36 by cchauvet ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */