Fixed Sparc problem in mbtask, added one installdir to main Makefile

This commit is contained in:
Michiel Broek
2001-11-01 20:32:53 +00:00
parent 12702344eb
commit 00f8a7d81a
6 changed files with 274 additions and 215 deletions

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbtask/mbtask.c
* Purpose ...............: MBSE BBS Task Manager
* Last modification date : 25-Oct-2001
* Last modification date : 01-Nov-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -429,6 +429,7 @@ void load_taskcfg(void)
sprintf(TCFG.cmd_msglink, "%s/bin/mbmsg link -quiet", getenv("MBSE_ROOT"));
sprintf(TCFG.cmd_reqindex, "%s/bin/mbfile index -quiet", getenv("MBSE_ROOT"));
TCFG.ipblocks = TRUE;
TCFG.debug = FALSE;
TCFG.max_pots = 1;
TCFG.max_isdn = 0;
TCFG.max_tcp = 0;
@@ -778,7 +779,13 @@ void ulocktask(void)
# define icmp_type type
# define icmp_code code
# define icmp_cksum checksum
# ifdef icmp_id
# undef icmp_id
# endif
# define icmp_id un.echo.id
# ifdef icmp_seq
# undef icmp_seq
# endif
# define icmp_seq un.echo.sequence
#endif
@@ -1032,7 +1039,8 @@ void scheduler(void)
struct passwd *pw;
int running = 0, rc, rlen;
int LOADhi = FALSE, oldmin = 70, olddo = 70;
char *cmd = NULL, doing[32], buf[2048];
char *cmd = NULL;
static char doing[32], buf[2048];
time_t now;
struct tm *tm;
FILE *fp;

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbtask/taskcomm.c
* Purpose ...............: MBSE BBS Daemon
* Last modification date : 05-Jul-2001
* Last modification date : 01-Nov-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -27,14 +27,6 @@
* You should have received a copy of the GNU General Public License
* along with MB BBS; see the file COPYING. If not, write to the Free
* Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*****************************************************************************
*
* This program uses the BSD IPC stream sockets mechanism. This is the
* server program. You need an entry in /etc/services for tcp service
* "mbse" on port 60180. Yes, this is 1 higher as for ifcico. You don't
* need an entry in inetd.conf, because this program is written as a
* daemon for fast access.
*
*****************************************************************************/
#include "libs.h"
@@ -442,11 +434,11 @@ void do_cmd(char *cmd)
char buf[SS_BUFSIZE];
int slen, tries = 0;
sprintf(buf, "%s", exe_cmd(cmd));
if (logtrans) {
if (logtrans)
tasklog('-', "< %s", cmd);
sprintf(buf, "%s", exe_cmd(cmd));
if (logtrans)
tasklog('-', "> %s", buf);
}
for (;;) {
slen = sendto(sock, buf, strlen(buf), 0, &from, fromlen);

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbtask/taskstat.c
* Purpose ...............: Keep track of server status
* Last modification date : 30-Jul-2001
* Last modification date : 31-Oct-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -139,17 +139,18 @@ void status_write(void);
void status_write(void)
{
int d, stat_fd;
struct tm ttm, ytm;
struct tm *ttm, *ytm;
time_t temp;
temp = time(NULL);
ttm = *localtime(&temp);
ytm = *localtime(&status.daily);
ttm = localtime(&temp);
temp = status.daily; // On a Sparc, first put the time in temp, then pass it to locattime.
ytm = localtime(&temp);
/*
* If we passed to the next day, zero the today counters
*/
if (ttm.tm_yday != ytm.tm_yday) {
if (ttm->tm_yday != ytm->tm_yday) {
tasklog('+', "Last days statistics:");
tasklog('+', "Total clients : %lu", status.today.tot_clt);
tasklog('+', "Peak clients : %lu", status.today.peak_clt);
@@ -161,11 +162,19 @@ void status_write(void)
tasklog('+', "Zeroed todays status counters");
}
stat_fd = open(stat_fn, O_RDWR);
d = lseek(stat_fd, 0, SEEK_SET);
if ((stat_fd = open(stat_fn, O_RDWR)) == -1) {
tasklog('?', "$Error open statusfile %s", stat_fn);
return;
}
if ((d = lseek(stat_fd, 0, SEEK_SET)) != 0) {
tasklog('?', "$Error seeking in statusfile");
return;
}
d = write(stat_fd, &status, sizeof(status_r));
if (d != sizeof(status_r))
tasklog('?', "Error writing statusfile, only %d bytes", d);
tasklog('?', "$Error writing statusfile, only %d bytes", d);
/*
* CLose the statusfile