diff options
Diffstat (limited to 'src/c_input.c')
-rw-r--r-- | src/c_input.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/c_input.c b/src/c_input.c index 8f15449..5e7e937 100644 --- a/src/c_input.c +++ b/src/c_input.c @@ -23,15 +23,32 @@ #include "m_prompt.h" #include "m_loop.h" +t_msh + *c_get_struct(int mode, t_msh *msh) +{ + static t_msh *mstruct = NULL; + + if (mode) + { + mstruct = msh; + } + return (mstruct); +} void c_signal_int(int signo) { + t_msh *msh; + + msh = NULL; signal(SIGINT, c_signal_int); (void)signo; + msh = c_get_struct(0, msh); + msh->ret = 130; + write(1, "qwe", 3); ioctl(1, TIOCSTI, "\002"); } -void signal_ign(int signo) +void c_signal_ign(int signo) { signal(SIGINT, c_signal_int); (void)signo; @@ -50,7 +67,7 @@ short return (-1); c_set_term_raw(1); signal(SIGINT, c_signal_int); - signal(SIGQUIT, signal_ign); + signal(SIGQUIT, c_signal_ign); tcaps->cpos = 0; tcaps->lpos = 0; tcaps->nlines = 1; |