diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c index 7d1695c5d9d8fb0e5c0763da8011c60a7f1774d4..8c1c978c25b3859b1a3b5008f4a6767e17cb8872 100644 --- a/src/sbbs3/ftpsrvr.c +++ b/src/sbbs3/ftpsrvr.c @@ -4363,21 +4363,6 @@ void DLLCALL ftp_server(void* arg) srand(clock()); /* Seed random number generator */ sbbs_random(10); /* Throw away first number */ - if(!(startup->options&FTP_OPT_LOCAL_TIMEZONE)) { - if(PUTENV("TZ=UTC0")) - lprintf("!putenv() FAILED"); - tzset(); - - if((t=checktime())!=0) { /* Check binary time */ - lprintf("!TIME PROBLEM (%ld)",t); - cleanup(1); - return; - } - } - - if(uptime==0) - uptime=time(NULL); - if(!winsock_startup()) { cleanup(1); return; @@ -4407,6 +4392,21 @@ void DLLCALL ftp_server(void* arg) return; } + if(!(scfg.sys_misc&SM_LOCAL_TZ) && !(startup->options&FTP_OPT_LOCAL_TIMEZONE)) { + if(PUTENV("TZ=UTC0")) + lprintf("!putenv() FAILED"); + tzset(); + + if((t=checktime())!=0) { /* Check binary time */ + lprintf("!TIME PROBLEM (%ld)",t); + cleanup(1); + return; + } + } + + if(uptime==0) + uptime=time(NULL); + /* Use DATA/TEMP for temp dir - should ch'd to be FTP/HOST specific */ prep_dir(scfg.data_dir, scfg.temp_dir); diff --git a/src/sbbs3/mailsrvr.c b/src/sbbs3/mailsrvr.c index 7f25418858723c4617bcf111faf600119e7f21f7..e4362bc2a409e2734b29d9541d9d9b4e28fb5fb2 100644 --- a/src/sbbs3/mailsrvr.c +++ b/src/sbbs3/mailsrvr.c @@ -2684,18 +2684,6 @@ void DLLCALL mail_server(void* arg) srand(time(NULL)); - if(!(startup->options&MAIL_OPT_LOCAL_TIMEZONE)) { - if(PUTENV("TZ=UTC0")) - lprintf("!putenv() FAILED"); - tzset(); - - if((t=checktime())!=0) { /* Check binary time */ - lprintf("!TIME PROBLEM (%ld)",t); - cleanup(1); - return; - } - } - if(!winsock_startup()) { cleanup(1); return; @@ -2717,6 +2705,18 @@ void DLLCALL mail_server(void* arg) return; } + if(!(scfg.sys_misc&SM_LOCAL_TZ) && !(startup->options&MAIL_OPT_LOCAL_TIMEZONE)) { + if(PUTENV("TZ=UTC0")) + lprintf("!putenv() FAILED"); + tzset(); + + if((t=checktime())!=0) { /* Check binary time */ + lprintf("!TIME PROBLEM (%ld)",t); + cleanup(1); + return; + } + } + if(startup->max_clients==0) { startup->max_clients=scfg.sys_nodes; if(startup->max_clients<10) diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 575b413043e4d74d0e88174f7f3efd7e07fe7ebc..6bb8219e859734cd93796680e0f20366d4842ba9 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -3091,20 +3091,6 @@ void DLLCALL bbs_thread(void* arg) return; } - if(!(startup->options&BBS_OPT_LOCAL_TIMEZONE)) { - if(PUTENV("TZ=UTC0")) - lprintf("!putenv() FAILED"); - tzset(); - - if((t=checktime())!=0) { /* Check binary time */ - lprintf("!TIME PROBLEM (%ld)",t); - cleanup(1); - return; - } - } - - uptime=time(NULL); - #ifdef _WIN32 if((exec_mutex=CreateMutex(NULL,false,NULL))==NULL) { lprintf("!ERROR %d creating exec_mutex", GetLastError()); @@ -3146,6 +3132,20 @@ void DLLCALL bbs_thread(void* arg) } scfg_reloaded=true; + if(!(scfg.sys_misc&SM_LOCAL_TZ) && !(startup->options&BBS_OPT_LOCAL_TIMEZONE)) { + if(PUTENV("TZ=UTC0")) + lprintf("!putenv() FAILED"); + tzset(); + + if((t=checktime())!=0) { /* Check binary time */ + lprintf("!TIME PROBLEM (%ld)",t); + cleanup(1); + return; + } + } + + uptime=time(NULL); + if(startup->last_node>scfg.sys_nodes) { lprintf("Specified last_node (%d) > sys_nodes (%d), auto-corrected" ,startup->last_node, scfg.sys_nodes); diff --git a/src/sbbs3/sbbsdefs.h b/src/sbbs3/sbbsdefs.h index 3b613e3ff54a5c4c59a4775f74c245c041d837cb..c5c48c483bdc5046de33b31ccde3ddbee5b9f5f7 100644 --- a/src/sbbs3/sbbsdefs.h +++ b/src/sbbs3/sbbsdefs.h @@ -141,7 +141,7 @@ #define SM_CELERITY (1L<<10) /* Expand Celerity color codes in messages */ #define SM_RENEGADE (1L<<11) /* Expand Renegade color codes in messages */ #define SM_ECHO_PW (1L<<12) /* Echo passwords locally */ -#define SM_UNUSED (1L<<13) /* <UNUSED> */ +#define SM_LOCAL_TZ (1L<<13) /* Use local timezone representations */ #define SM_L_SYSOP (1L<<14) /* Allow local sysop logon/commands */ #define SM_R_SYSOP (1L<<15) /* Allow remote sysop logon/commands */ #define SM_QUOTE_EM (1L<<16) /* Allow quoting of e-mail */ diff --git a/src/sbbs3/services.c b/src/sbbs3/services.c index 15a1fa6f7f930ab025d73cf6f12b2c5dc3e06d69..e622e3af5958b88233dc686965b1f99cc678df11 100644 --- a/src/sbbs3/services.c +++ b/src/sbbs3/services.c @@ -1058,21 +1058,6 @@ void DLLCALL services_thread(void* arg) srand(clock()); /* Seed random number generator */ sbbs_random(10); /* Throw away first number */ - if(!(startup->options&BBS_OPT_LOCAL_TIMEZONE)) { - if(PUTENV("TZ=UTC0")) - lprintf("!putenv() FAILED"); - tzset(); - - if((t=checktime())!=0) { /* Check binary time */ - lprintf("!TIME PROBLEM (%ld)",t); - cleanup(1); - return; - } - } - - if(uptime==0) - uptime=time(NULL); - if(!winsock_startup()) { cleanup(1); return; @@ -1094,6 +1079,21 @@ void DLLCALL services_thread(void* arg) return; } + if(!(scfg.sys_misc&SM_LOCAL_TZ) && !(startup->options&BBS_OPT_LOCAL_TIMEZONE)) { + if(PUTENV("TZ=UTC0")) + lprintf("!putenv() FAILED"); + tzset(); + + if((t=checktime())!=0) { /* Check binary time */ + lprintf("!TIME PROBLEM (%ld)",t); + cleanup(1); + return; + } + } + + if(uptime==0) + uptime=time(NULL); + active_clients=0; update_clients();