void ft_sig_winch(int sig) { t_opt *opts; struct winsize ws; (void)sig; opts = ft_get_opts(); signal(SIGWINCH, ft_sig_winch); if (ioctl(0, TIOCGWINSZ, &ws) != -1) ioctl(opts->master, TIOCSWINSZ, &ws); }
int main(int ac, char **av, char **env) { t_opt *opts; opts = ft_get_opts(); opts->env = env; if (ERR == ft_fill_opts(opts, ac, av)) return (ERR); ft_find_shell(opts, env); if (ERR == ft_script(opts)) return (ERR); return (OK); }
void ft_sig_child(int sig) { t_opt *opts; (void)sig; opts = ft_get_opts(); if (!opts->q) write(1, "\n", 1); if (opts->zombi) ft_end(opts->zombi); else ft_end(0); }