summaryrefslogtreecommitdiffstats
path: root/src/m_minishell.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/m_minishell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/m_minishell.c b/src/m_minishell.c
index 987cfc0..a3226fe 100644
--- a/src/m_minishell.c
+++ b/src/m_minishell.c
@@ -32,6 +32,11 @@ int main(int argc, char *const argv[], char *const envp[])
ft_dprintf(STDERR_FILENO, "%s\n", strerror(errno));
return (M_RET_ALLOC);
}
+ if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO))
+ {
+ ft_dprintf(2, "minishell: innapropriate ioctl device.");
+ exit(1);
+ }
ret = m_argv(argc, argv, msh);
s_destroy(msh);
return (ret);