mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
refactor(signal): remove unneded function
excve already resets signal handling to the default
This commit is contained in:
parent
cb8f64367d
commit
3a309062d8
2 changed files with 3 additions and 29 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jguelen <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/20 10:26:05 by jguelen #+# #+# */
|
||||
/* Updated: 2025/04/04 14:25:35 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/04 16:56:06 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -85,28 +85,3 @@ int set_exec_mode_sig_handling(void)
|
|||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
** Can be used at the start of a child process.
|
||||
** Check if necessary since execve is executed.
|
||||
** @RETURN Return 0 i case of success, -1 in case of error and errno is set
|
||||
** to indicate the error.
|
||||
*/
|
||||
int set_default_sig_handling(void)
|
||||
{
|
||||
struct sigaction sig;
|
||||
int i;
|
||||
|
||||
ft_bzero(&sig, sizeof(struct sigaction));
|
||||
sig.sa_handler = SIG_DFL;
|
||||
if (sigemptyset(&sig.sa_mask) == -1)
|
||||
return (-1);
|
||||
i = 0;
|
||||
while (i < NSIG)
|
||||
{
|
||||
if (sigaction(i, &sig, NULL) == -1)
|
||||
return (-1);
|
||||
i++;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* sig.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 18:21:55 by jguelen #+# #+# */
|
||||
/* Updated: 2025/03/11 17:36:07 by jguelen ### ########.fr */
|
||||
/* Updated: 2025/04/04 16:58:12 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -31,6 +31,5 @@ extern int g_signum;
|
|||
|
||||
int set_interactive_mode_sig_handling(void);
|
||||
int set_exec_mode_sig_handling(void);
|
||||
int set_default_sig_handling(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue