Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 858b6788 authored by rswindell's avatar rswindell

Move term_env from static (BSS) variable to sbbs_t member. Static member...

Move term_env from static (BSS) variable to sbbs_t member. Static member function variables are shared among threads, so this was just a race-condition waiting to happen. <grimmace>
parent 2fd95ac4
...@@ -1010,6 +1010,7 @@ public: ...@@ -1010,6 +1010,7 @@ public:
/* xtrn.cpp */ /* xtrn.cpp */
int external(const char* cmdline, long mode, const char* startup_dir=NULL); int external(const char* cmdline, long mode, const char* startup_dir=NULL);
long xtrn_mode; long xtrn_mode;
char term_env[256];
/* xtrn_sec.cpp */ /* xtrn_sec.cpp */
int xtrn_sec(const char* section = ""); /* The external program section */ int xtrn_sec(const char* section = ""); /* The external program section */
......
...@@ -1529,11 +1529,10 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir) ...@@ -1529,11 +1529,10 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
sigfillset(&sigs); sigfillset(&sigs);
sigprocmask(SIG_UNBLOCK,&sigs,NULL); sigprocmask(SIG_UNBLOCK,&sigs,NULL);
if(!(mode&EX_BIN)) { if(!(mode&EX_BIN)) {
static char term_env[256];
if(term_supports(ANSI)) if(term_supports(ANSI))
sprintf(term_env,"TERM=%s",startup->xtrn_term_ansi); SAFEPRINTF(term_env,"TERM=%s",startup->xtrn_term_ansi);
else else
sprintf(term_env,"TERM=%s",startup->xtrn_term_dumb); SAFEPRINTF(term_env,"TERM=%s",startup->xtrn_term_dumb);
putenv(term_env); putenv(term_env);
} }
#ifdef __FreeBSD__ #ifdef __FreeBSD__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment