/* ************************************************************************** */ /* */ /* :::::::: */ /* executor_fork.c :+: :+: */ /* +:+ */ /* By: willem +#+ */ /* +#+ */ /* Created: 2025/02/12 21:24:52 by willem #+# #+# */ /* Updated: 2025/02/25 13:51:48 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ #include "minishell.h" pid_t executor_fork(t_minishell *minishell, t_command *command) { pid_t pid; // int status; pid = fork(); if (pid > 0) { if (command->fd_in != 0) close(command->fd_in); if (command->fd_out != 1) close(command->fd_out); // waitpid(pid, &status, 0); // return (((status) & 0xff00) >> 8); signal_init_parent(); } else if (pid == 0) { signal_init_child(); executor_child(minishell, command); exit(127); } else perror("fork"); return (pid); }