mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-11 23:18:46 +02:00
「✏️」 norm: Normed everything and leak erased from the surface of the earth and what the fuck am i doing at this hour coding i shoud be sleeping 1:30am wtf god damn please give me a bed and fuck you yosyo 🖕
This commit is contained in:
38
src/exec/utils_exec_2.c
Normal file
38
src/exec/utils_exec_2.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* utils_exec_2.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/09 22:53:01 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/09 22:57:38 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "minishell.h"
|
||||
|
||||
void __wait(int i)
|
||||
{
|
||||
while (i - 1)
|
||||
{
|
||||
waitpid(-1, NULL, 0);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
void __close(void *content)
|
||||
{
|
||||
if (((t_cmd *)(content))->outfile != STDOUT_FILENO)
|
||||
close(((t_cmd *)(content))->outfile);
|
||||
if (((t_cmd *)(content))->infile != STDIN_FILENO)
|
||||
close(((t_cmd *)(content))->infile);
|
||||
}
|
||||
|
||||
int send_error_exec(char *input)
|
||||
{
|
||||
printf("minishell : command not found: %s\n", input);
|
||||
free(input);
|
||||
return (-1);
|
||||
}
|
Reference in New Issue
Block a user