From 1d5c0cde97a29000eb313f024ec795d3f8287c90 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Thu, 2 Jan 2003 01:05:32 +0000 Subject: [PATCH] Deuce's mod: no longer blocks signals while running externals on Unix (needed for alarm signals in rz). --- src/sbbs3/xtrn.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/sbbs3/xtrn.cpp b/src/sbbs3/xtrn.cpp index 8ff3dfa343..441dbeccda 100644 --- a/src/sbbs3/xtrn.cpp +++ b/src/sbbs3/xtrn.cpp @@ -56,14 +56,22 @@ #include <grp.h> #endif + #define TTYDEFCHARS #include <termios.h> + #endif #define XTRN_IO_BUF_LEN 5000 #ifdef __solaris__ -# define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY) -# define TTYDEF_OFLAG (OPOST | ONLCR) -# define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) +# define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY) +# define TTYDEF_OFLAG (OPOST | ONLCR) +# define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) +# define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) + static cc_t ttydefchars[NCCS] = { + CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, + CERASE2, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, + CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE + }; #endif /*****************************************************************************/ @@ -1161,6 +1169,8 @@ int sbbs_t::external(char* cmdline, long mode, char* startup_dir) term.c_iflag = TTYDEF_IFLAG; term.c_oflag = TTYDEF_OFLAG; term.c_lflag = TTYDEF_LFLAG; + term.c_cflag = TTYDEF_CFLAG; + term.c_cc = ttydefchars; } winsize.ws_row=rows; // #warning Currently cols are forced to 80 apparently TODO @@ -1192,6 +1202,9 @@ int sbbs_t::external(char* cmdline, long mode, char* startup_dir) } } if(pid==0) { /* child process */ + sigset_t sigs; + sigfillset(&sigs); + sigprocmask(SIG_UNBLOCK,&sigs,NULL); if(!(mode&EX_BIN)) { static char term_env[256]; sprintf(term_env,"TERM=%s",startup->xtrn_term); -- GitLab