Sparc systems fixes

This commit is contained in:
Michiel Broek
2001-12-23 16:44:18 +00:00
parent 2ce85589e4
commit a372efaea8
62 changed files with 170 additions and 193 deletions

View File

@@ -314,7 +314,7 @@ int binkp_expired(void)
{
time_t now;
(void)time(&now);
now = time(NULL);
if (now >= Timer)
Syslog('b', "Timer expired");
return (now >= Timer);
@@ -331,7 +331,7 @@ void b_banner(int originate)
binkp_send_control(MM_NUL,"ZYZ %s", CFG.sysop_name);
binkp_send_control(MM_NUL,"LOC %s", CFG.location);
binkp_send_control(MM_NUL,"NDL %s", CFG.Flags);
time(&t);
t = time(NULL);
binkp_send_control(MM_NUL,"TIME %s", rfcdate(t));
binkp_send_control(MM_NUL,"VER mbcico/%s binkp/1.0", VERSION);
if (strlen(CFG.Phone))
@@ -949,7 +949,7 @@ int binkp_batch(file_list *to_send)
Syslog('+', "Binkp: size %lu bytes, dated %s", (unsigned long)tmp->size, date(tmp->date));
binkp_send_control(MM_FILE, "%s %lu %ld %ld", MBSE_SS(tmp->remote),
(unsigned long)tmp->size, (long)tmp->date, (unsigned long)tmp->offset);
(void)time(&txstarttime);
txstarttime = time(NULL);
tmp->state = Sending;
cursend = tmp;
TxState = TxTryRead;
@@ -997,7 +997,7 @@ int binkp_batch(file_list *to_send)
/*
* calculate time needed and bytes transferred
*/
(void)time(&txendtime);
txendtime = time(NULL);
txstarttime = txendtime - txstarttime;
if (txstarttime <= 0L)
txstarttime = 1L;
@@ -1116,7 +1116,7 @@ int binkp_batch(file_list *to_send)
binkp_send_control(MM_GOT, "%s %ld %ld", rname, rsize, rtime);
closefile(TRUE);
rxpos = rxpos - rxbytes;
(void)time(&rxendtime);
rxendtime = time(NULL);
if ((rxstarttime = rxendtime - rxstarttime) == 0L)
rxstarttime = 1L;
Syslog('+', "Binkp: received OK %lu bytes in %s (%ld cps)",
@@ -1143,7 +1143,7 @@ int binkp_batch(file_list *to_send)
case RxAcceptFile:
Syslog('+', "Binkp: receive file \"%s\" date %s size %ld offset %ld", rname, date(rtime), rsize, roffs);
rxfp = openfile(rname, rtime, rsize, &rxbytes, resync);
(void)time(&rxstarttime);
rxstarttime = time(NULL);
rxpos = 0;
if (!diskfree(CFG.freespace)) {

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/callstat.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 05-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -69,7 +68,7 @@ void putstatus(faddr *addr, int incr, int sts)
else
cst->tryno += incr;
cst->trystat = sts;
(void)time(&cst->trytime);
cst->trytime = time(NULL);
fwrite(cst, sizeof(callstat), 1, fp);
fclose(fp);
if (cst->tryno >= 30)

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/dial.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 08-Jun-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -120,7 +119,7 @@ int hangup()
chat(modem.hangup, CFG.timeoutreset, NULL);
if (carrier) {
time(&c_end);
c_end = time(NULL);
online += (c_end - c_start);
Syslog('+', "Connection time %s", t_elapsed(c_start, c_end));
carrier = FALSE;

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/emsidat.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 24-Jun-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -223,7 +222,7 @@ char *mkemsidat(int caller)
p=xstrcat(p,(char *)"][");
p=xstrcat(p,flags?emsiencode(flags):(char *)"");
p=xstrcat(p,(char *)"]}{TRX#}{[");
(void)time(&tt);
tt = time(NULL);
sprintf(cbuf,"%08lX",mtime2sl(tt));
p=xstrcat(p,cbuf);
p=xstrcat(p,(char *)"]}{TZUTC}{[");

View File

@@ -838,7 +838,7 @@ int hydra_batch(int role, file_list *to_send)
Syslog('+', "Hydra: send \"%s\" as \"%s\"", MBSE_SS(to_send->local), MBSE_SS(to_send->remote));
Syslog('+', "Hydra: size %lu bytes, dated %s",(unsigned long)txstat.st_size, date(txstat.st_mtime));
(void) time(&txstarttime);
txstarttime = time(NULL);
}
txstate = HTX_ToFName;
@@ -1115,7 +1115,7 @@ int hydra_batch(int role, file_list *to_send)
/*
* calculate time needed and bytes transferred
*/
(void) time(&txendtime);
txendtime = time(NULL);
txstarttime = txendtime - txstarttime;
if (txstarttime <= 0L)
@@ -1324,7 +1324,7 @@ int hydra_batch(int role, file_list *to_send)
Name, filesize, date(timestamp));
rxfp = openfile(Name, timestamp, filesize, &rxpos, resync);
(void) time(&rxstarttime);
rxstarttime = time(NULL);
/* check for error opening file */
if (rxfp) {
@@ -1414,7 +1414,7 @@ int hydra_batch(int role, file_list *to_send)
/*
* calculate time and CPU usage needed
*/
(void) time(&rxendtime);
rxendtime = time(NULL);
if (rxpos >= 0) {
rxfp = NULL;

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: mbcico/lutil.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 12-Mar-2000
*
*****************************************************************************
* Copyright (C) 1997-2000
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -65,9 +64,9 @@ char *date(time_t t)
static char buf[20];
if (t)
now=t;
now = t;
else
time(&now);
now = time(NULL);
ptm=*localtime(&now);
sprintf(buf,"%s %02d %02d:%02d:%02d",
mon[ptm.tm_mon],ptm.tm_mday,

View File

@@ -136,7 +136,7 @@ void die(int onsig)
if (gotfiles)
CreateSema((char *)"mailin");
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBCICO finished in %s", t_elapsed(t_start, t_end));
free_mem();
if (envptr)
@@ -190,9 +190,7 @@ int main(int argc, char *argv[])
InitNode();
InitFidonet();
TermInit(1);
time(&t_start);
time(&c_start);
time(&c_end);
t_start = c_start = c_end = time(NULL);
InitClient(pw->pw_name, (char *)"mbcico", CFG.location, CFG.logfile, CFG.cico_loglevel, CFG.error_log);
Syslog(' ', " ");

View File

@@ -105,7 +105,7 @@ void die(int onsig)
WriteError("Terminated with error %d", onsig);
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBOUT finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) {
@@ -176,7 +176,7 @@ int main(int argc, char *argv[])
InitNode();
InitFidonet();
TermInit(1);
time(&t_start);
t_start = time(NULL);
umask(002);
/*

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: mbcico/outstat.c
* $Id$
* Purpose ...............: Show mail outbound status
* Last modification date : 23-Dec-2000
*
*****************************************************************************
* Copyright (C) 1997-2000
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -94,7 +93,7 @@ int outstat()
if ((tmp->flavors) & F_FREQ ) flstr[4]='R';
if ((tmp->flavors) & F_POLL ) flstr[5]='P';
(void)time(&age);
age = time(NULL);
age -= tmp->time;
sprintf(temp, "%s %8lu %s %s", flstr, (long)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f));
@@ -142,7 +141,7 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
(*tmp)->addr.point = addr->point;
(*tmp)->addr.domain = xstrcpy(addr->domain);
(*tmp)->flavors = 0;
time(&((*tmp)->time));
(*tmp)->time = time(NULL);
(*tmp)->size = 0L;
}
@@ -159,7 +158,7 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
if (stat(fname,&st) != 0) {
WriteError("$Can't stat %s", fname);
st.st_size = 0L;
(void)time(&st.st_mtime);
st.st_mtime = time(NULL);
}
/*
@@ -191,12 +190,12 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
* is losing mail or files.
*/
st.st_size = 0L;
(void)time(&st.st_mtime);
st.st_mtime = time(NULL);
}
} else {
if (stat(p, &st) != 0) {
st.st_size = 0L;
(void)time(&st.st_mtime);
st.st_mtime = time(NULL);
}
}
}

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/tcpproto.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 07-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -198,7 +197,7 @@ static int sendtfile(char *ln, char *rn)
if (st.st_size > 0) {
Syslog('+', "TCP send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn));
Syslog('+', "TCP size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
(void)time(&startime);
startime = time(NULL);
} else {
Syslog('+', "File \"%s\" has 0 size, skiped",ln);
return 0;
@@ -240,7 +239,7 @@ static int sendtfile(char *ln, char *rn)
}
if (rc == 0 && strncmp(rxbuf,"FOK",3) == 0) {
(void)time(&endtime);
endtime = time(NULL);
if ((startime=endtime-startime) == 0)
startime = 1;
@@ -275,7 +274,7 @@ static int closeit(int success)
rc = closefile(success);
fout = NULL;
sbytes = rxbytes - sbytes;
(void)time(&endtime);
endtime = time(NULL);
if ((startime = endtime - startime) == 0L)
startime = 1L;
@@ -312,7 +311,7 @@ static int receivefile(char *fn, time_t ft, off_t fs)
Syslog('+', "TCP receive \"%s\" (%lu bytes) dated %s",fn,fs,date(ft));
strcpy(txbuf,"ROK");
fout = openfile(fn, ft, fs, &rxbytes, resync);
(void)time(&startime);
startime = time(NULL);
sbytes = rxbytes;
if (fs == rxbytes) {

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: mbcico/ttyio.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 23-Dec-2000
*
*****************************************************************************
* Copyright (C) 1997-2000
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -127,7 +126,7 @@ int tty_expired(int tno)
if (timer[tno] == (time_t) 0)
return 0;
(void)time(&now);
now = time(NULL);
Syslog('T', "ttyio: expired(%d) now=%lu,timer=%lu,return %s",
tno,now,timer[tno],(now >= timer[tno])?"yes":"no");
return (now >= timer[tno]);
@@ -170,7 +169,7 @@ static int tty_read(char *buf, int size, int tot)
return 0;
tty_status = 0;
(void)time(&now);
now = time(NULL);
timeout = (time_t)300; /* maximum of 5 minutes */
for (i = 0; i < TIMERNO_TX; i++) {
@@ -325,7 +324,7 @@ int tty_waitputget(int tot)
struct timeval seltimer;
tty_status=0;
(void)time(&now);
now = time(NULL);
timeout=(time_t)300; /* maximum of 5 minutes */
for (i = 0; i < NUMTIMERS; i++) {
@@ -508,7 +507,7 @@ int tty_putget(char **obuf, int *osize, char **ibuf, int *isize)
struct timeval seltimer;
tty_status = 0;
(void)time(&now);
now = time(NULL);
timeout = (time_t)300; /* maximum of 5 minutes */
for (i = 0; i < NUMTIMERS; i++) {

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/xmrecv.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 04-Jan-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -89,7 +88,7 @@ int closeit(int success)
off_t endofs;
endofs = recv_blk*XMBLKSIZ;
(void)time(&etm);
etm = time(NULL);
if (etm == stm)
etm++;
Syslog('+', "Xmodem %s %lu bytes in %s (%lu cps)", success?"received":"dropped after",
@@ -147,7 +146,7 @@ SM_EDECL
int goteot = FALSE;
Syslog('x', "xmrecv INIT");
(void)time(&stm);
stm = time(NULL);
recv_blk=-1L;
memset(&tmpfname, 0, sizeof(tmpfname));

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/xmsend.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 04-Jan-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -123,7 +122,7 @@ SM_EDECL
fl.l_len=0L;
Syslog('x', "xmsend INIT");
(void)time(&stm);
stm = time(NULL);
/* if we got 'C' than hopefully remote is sealink capable... */
@@ -236,7 +235,7 @@ SM_STATE(sendblk)
} else if (ackd_blk < last_blk) {
SM_PROCEED(waitack);
} else {
(void)time(&etm);
etm = time(NULL);
if (etm == stm)
etm++;
Syslog('+', "sent %lu bytes in %s (%lu cps)", (unsigned long)st.st_size,str_time(etm-stm),

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/zmrecv.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 10-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -442,7 +441,7 @@ int closeit(int success)
rc = closefile(success);
fout = NULL;
sbytes = rxbytes - sbytes;
(void)time(&etime);
etime = time(NULL);
if ((startime = etime - startime) == 0L)
startime = 1L;
Syslog('+', "Zmodem: %s %lu bytes in %s (%ld cps)", success?"OK":"dropped after",
@@ -515,7 +514,7 @@ int procheader(char *Name)
Syslog('+', "Zmodem: \"%s\" %ld bytes, %s mode %o", Name, Bytesleft, ctt, Filemode);
fout = openfile(Name,Modtime,Bytesleft,&(long)(rxbytes),resync);
(void)time(&startime);
startime = time(NULL);
sbytes = rxbytes;
if (Bytesleft == rxbytes) {

View File

@@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbcico/zmsend.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 07-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -212,7 +211,7 @@ static int sendzfile(char *ln, char *rn)
Syslog('+', "Zmodem: send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn));
Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
(void)time(&startime);
startime = time(NULL);
sprintf(txbuf,"%s %lu %lo %o 0 0 0", rn,(unsigned long)st.st_size, st.st_mtime+(st.st_mtime%2), st.st_mode);
bufl = strlen(txbuf);
@@ -224,7 +223,7 @@ static int sendzfile(char *ln, char *rn)
Syslog('+', "Zmodem: remote skipped %s, is OK",MBSE_SS(ln));
return 0;
} else if ((rc == OK) && (st.st_size - skipsize)) {
(void)time(&endtime);
endtime = time(NULL);
if ((startime = endtime - startime) == 0)
startime = 1;
Syslog('+', "Zmodem: OK %lu bytes in %s (%ld cps)", (unsigned long)st.st_size - skipsize, str_time(startime),