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

@ -4246,6 +4246,7 @@ v0.33.19 26-Oct-2001
When adding seenby entries, the zone number is copied from the
previous adress just like with the net numbers. This is for
old style tic files, they were not full 3d.
Fixes for Sparc systems.
lang:
Changed language prompts 6, 71, 429.
@ -4275,6 +4276,7 @@ v0.33.19 26-Oct-2001
When an new area is made available, the database is created.
The AREADEF lines in golded.inc now contain the aka to use
instead of a dot.
Fixes for Sparc systems.
mbsebbs:
Added menu 317, change FS editor shortcut keys to (Emacs/
@ -4331,11 +4333,13 @@ v0.33.19 26-Oct-2001
should not disable this if you restrict access to some file
areas if you want to test the users age. Also the age in the
users record is invalid.
Fixes for Sparc systems.
mbnewusr:
New program, run by user bbs. This is only to register a new
bbs user. Should be started by the bbs account.
Ask Date of Birth now only is asked if set in configuration.
Fixes for Sparc systems.
mbcico:
Removed IEMSI support since mbsebbs doesn't support it
@ -4351,6 +4355,10 @@ v0.33.19 26-Oct-2001
The hydra driver now sends 8.3 mangled filenames and long
filenames as specified in the specs.
Corrected the location of the modem lockfile on FreeBSD.
Fixes for Sparc systems.
mbout:
Fixes for Sparc systems.
mbtask:
Changed to handle the External Doors flag in the lastcaller
@ -4365,9 +4373,11 @@ v0.33.19 26-Oct-2001
information.
When lastcaller info is scrolling, the lines are first proper
erased.
Fixes for Sparc systems.
mbmsg:
Corrected header in logfile for pack function.
Fixes for Sparc systems.
import:
Removed users import, could not work anymore.
@ -4388,6 +4398,7 @@ v0.33.19 26-Oct-2001
rescan option.
Implemented long filenames with hatch. Now uses ticfile key-
word Fullname for the long filename.
Fixes for Sparc systems.
mbfile:
During check the file databases are reset to filemode 0660.
@ -4415,10 +4426,21 @@ v0.33.19 26-Oct-2001
at the same time.
Implemented "mbfile delete" and "mbfile undelete" commands.
The command mbfile check now removes obsolete file databases.
Fixes for Sparc systems.
mball:
The index function is now obsolete, this is added to mbfile.
You may need to adjust your scripts that call "mball index".
Fixes for Sparc systems.
mbaff:
Fixes for Sparc systems.
mbindex:
Fixes for Sparc systems.
mbdiff:
Fixes for Sparc systems.
mbfbgen:
Obsolete and removed from the distribution. The function is

View File

@ -1,12 +1,11 @@
/*****************************************************************************
*
* File ..................: gmtoffset.c
* $Id$
* Purpose ...............: Calculate UTC offset
* Last modification date : 18-Dec-1999
* Source ................: Eugene G. Crosser's ifmail package.
*
*****************************************************************************
* Copyright (C) 1997-1999
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -47,7 +46,7 @@ long gmt_offset(time_t now)
long offset;
if (!now)
time(&now);
now = time(NULL);
ptm = *localtime(&now);
/*

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: packet.c
* $Id$
* Purpose ...............: Fidonet mailer
* Last modification date : 06-Jun-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -113,7 +112,7 @@ FILE *openpkt(FILE *pkt, faddr *addr, char flavor)
Syslog('P', "creating new .pkt");
memset(&buffer, 0, sizeof(buffer));
time(&t);
t = time(NULL);
ptm = localtime(&t);
if (ptm->tm_sec > 59)
ptm->tm_sec = 59;

View File

@ -1,4 +1,6 @@
/* $Revision$
/* $Id$
**
** $ Revision: 1.2 $
**
** Originally written by Steven M. Bellovin <smb@research.att.com> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
@ -1427,7 +1429,7 @@ int GetTimeInfo(TIMEINFO *Now)
Now->usec = tv.tv_usec;
#else
/* Can't check for -1 since that might be a time, I guess. */
(void)time(&Now->time);
Now->time = time(NULL);
Now->usec = 0;
#endif /* defined(HAVE_GETTIMEOFDAY) */

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: pktname.c
* $Id$
* Purpose ...............: BinkleyTerm outbound naming
* Last modification date : 23-Dec-2000
*
*****************************************************************************
* Copyright (C) 1997-2000
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -228,7 +227,7 @@ char *dayname(void)
time_t tt;
struct tm *ptm;
(void)time(&tt);
tt = time(NULL);
ptm = localtime(&tt);
sprintf(buf, "%s", dow[ptm->tm_wday]);
@ -245,7 +244,7 @@ char *arcname(faddr *addr, unsigned short Zone, int ARCmailCompat)
struct tm *ptm;
faddr *bestaka;
(void)time(&tt);
tt = time(NULL);
ptm = localtime(&tt);
ext = dow[ptm->tm_wday];

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: rfcdate.c
* $Id$
* Purpose ...............: Date utilities
* Last modification date : 30-Apr-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -149,7 +148,7 @@ char *rfcdate(time_t now)
long offset;
if (!now)
time(&now);
now = time(NULL);
ptm = *localtime(&now);
/*

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: strutil.c
* $Id$
* Purpose ...............: Common string functions
* Last modification date : 18-Mar-2000
*
*****************************************************************************
* Copyright (C) 1997-2000
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -264,7 +263,7 @@ char *GetLocalHM()
static char gettime[15];
time_t T_Now;
time(&T_Now);
T_Now = time(NULL);
sprintf(gettime,"%s", StrTimeHM(T_Now));
return(gettime);
}
@ -280,7 +279,7 @@ char *GetLocalHMS()
static char gettime[15];
time_t T_Now;
time(&T_Now);
T_Now = time(NULL);
sprintf(gettime,"%s", StrTimeHMS(T_Now));
return(gettime);
}
@ -328,30 +327,10 @@ char *GetDateDMY()
struct tm *l_d;
time_t T_Now;
time(&T_Now);
T_Now = time(NULL);
l_d = localtime(&T_Now);
sprintf(tdate, "%02d-%02d-%04d", l_d->tm_mday,l_d->tm_mon+1,l_d->tm_year+1900);
return(tdate);
}
/*
* Returns current date in DDMMYYY
*/
/*
char *tDate1()
{
static char tdate1[15];
struct tm *l_d;
time_t T_Now;
time(&T_Now);
l_d = localtime(&T_Now);
sprintf(tdate1, "%02d%02d%02d",
l_d->tm_mday,l_d->tm_mon+1,l_d->tm_year+1900);
return(tdate1);
}
*/

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),

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbfido/addpkt.c
* $Id$
* Purpose ...............: Add mail to .pkt
* Last modification date : 31-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -68,7 +67,7 @@ FILE *CreatePkt(char *Queue, fidoaddr Orig, fidoaddr Dest, char *Extension)
* Write .PKT header, see FSC-0039 rev. 4
*/
memset(&buffer, 0, sizeof(buffer));
time(&Now);
Now = time(NULL);
Tm = localtime(&Now);
if (Tm->tm_sec > 59)
Tm->tm_sec = 59;

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbfido/aliasdb.c
* $Id$
* Purpose ...............: Alias Database
* Last modification date : 11-May-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -137,7 +136,7 @@ int registrate(char *freename, char *address)
/*
* Already present, update date/time.
*/
time(&key.dtime);
key.dtime = time(NULL);
fseek(afp, - sizeof(key), SEEK_CUR);
fwrite(&key, sizeof(key), 1, afp);
close_alias_db();
@ -147,7 +146,7 @@ int registrate(char *freename, char *address)
sprintf(key.freename, "%s", buf);
sprintf(key.address, "%s", address);
time(&key.dtime);
key.dtime = time(NULL);
if (fwrite(&key, sizeof(key), 1, afp) != 1) {
WriteError("$Cannot store: \"%s\" \"%s\"", MBSE_SS(buf), MBSE_SS(address));

View File

@ -1,9 +1,7 @@
/*****************************************************************************
*
* File ..................: mbfido/ftn2rfc.c
* $Id$
* Purpose ...............: Gate netmail->email or echomail->news
* Last modification date : 29-Oct-2001
* Last modification date : 30-Oct-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -900,7 +898,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
}
} else { /* if newsmode */
time(&now);
now = time(NULL);
if (CFG.EmailMode == E_NOISP) {
/*
* Probaly not needed as messages for systems without ISP never get here.
@ -1083,13 +1081,14 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
/*
* Restamp future postings
*/
if(mdate > time(&now)) {
now = time(NULL);
if (mdate > now) {
Syslog('+', "Future posting: %s", rfcdate(mdate));
sprintf(temp,"Date: %s\n", rfcdate(now));
Send(newsmode, temp);
sprintf(temp,"X-Origin-Date: %s\n", rfcdate(mdate));
Send(newsmode, temp);
} else if((mdate < time(&now)-14*24*60*60) && (mdate > time(&now)-RESTAMP_OLD_POSTINGS*24*60*60)) {
} else if ((mdate < now-14*24*60*60) && (mdate > time(&now)-RESTAMP_OLD_POSTINGS*24*60*60)) {
/*
* Restamp old postings
*/

View File

@ -74,7 +74,7 @@ void die(int onsig)
WriteError("Terminated with error %d", onsig);
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBAFF finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) {
@ -98,7 +98,7 @@ int main(int argc, char **argv)
#endif
InitConfig();
TermInit(1);
time(&t_start);
t_start = time(NULL);
t = localtime(&t_start);
Diw = t->tm_wday;
Miy = t->tm_mon;

View File

@ -98,7 +98,7 @@ void die(int onsig)
WriteError("Terminated with error %d", onsig);
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBDIFF finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) {
@ -126,7 +126,7 @@ int main(int argc, char **argv)
#endif
InitConfig();
TermInit(1);
time(&t_start);
t_start = time(NULL);
umask(002);
/*

View File

@ -234,7 +234,7 @@ void die(int onsig)
if (notify + areamgr + filemgr)
Syslog('+', "Notify msgs [%4d] AreaMgr [%4d] FileMgr [%4d]", notify, areamgr, filemgr);
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBFIDO finished in %s", t_elapsed(t_start, t_end));
ulockunpack();
@ -296,7 +296,7 @@ int main(int argc, char **argv)
InitUser();
InitFidonet();
TermInit(1);
time(&t_start);
t_start = time(NULL);
t = localtime(&t_start);
Diw = t->tm_wday;
Miy = t->tm_mon;

View File

@ -79,7 +79,7 @@ int main(int argc, char **argv)
#endif
InitConfig();
TermInit(1);
time(&t_start);
t_start = time(NULL);
umask(002);
/*

View File

@ -91,7 +91,7 @@ void die(int onsig)
WriteError("Terminated with error %d", onsig);
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBFILE finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) {

View File

@ -192,7 +192,7 @@ void die(int onsig)
WriteError("Terminated with error %d", onsig);
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBINDEX finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet)

View File

@ -92,7 +92,7 @@ int main(int argc, char **argv)
InitConfig();
TermInit(1);
oldmask = umask(007);
time(&t_start);
t_start = time(NULL);
/*
* Catch all signals we can, and ignore or catch them
@ -235,7 +235,7 @@ void die(int onsig)
if (msg_tot || msg_del)
Syslog('+', "Msgs [%5d] Deleted [%5d]", msg_tot, msg_del);
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBMSG finished in %s", t_elapsed(t_start, t_end));
umask(oldmask);

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbaff/msgutil.c
* $Id$
* Purpose ...............: Announce new files and FileFind
* Last modification date : 21-Jan-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -91,7 +90,7 @@ void Msg_Pid(void)
sprintf(temp, "\001PID: MBSE-FIDO %s", VERSION);
MsgText_Add2(temp);
sprintf(temp, "\001CHRS: %s", getchrs(msgs.Ftncode));
(void)time(&tt);
tt = time(NULL);
sprintf(temp, "\001TZUTC: %s", gmtoffset(tt));
MsgText_Add2(temp);
free(temp);

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbfido/post.c
* $Id$
* Purpose ...............: Post a message from a file.
* Last modification date : 20-Mar-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -117,7 +116,7 @@ void Post(char *To, long Area, char *Subj, char *File, char *Flavor)
return;
}
(void)time(&tt);
tt = time(NULL);
t = localtime(&tt);
Diw = t->tm_wday;
Miy = t->tm_mon;

View File

@ -84,7 +84,7 @@ int ProcessTic(fa_list *sbl)
int BBS_Imp = FALSE, DidBanner = FALSE;
time(&Now);
Now = time(NULL);
if (TIC.TicIn.PathError) {
WriteError("Our Aka is in the path");

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: tosser/storenet.c
* Purpose ...............: Import a netmail message
* Last modification date : 28-Jul-2001
* $Id$
* Purpose ...............: Import a echomail message
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -69,9 +68,9 @@ int storeecho(faddr *f, faddr *t, time_t mdate, int flags, char *subj, char *msg
*/
if (!bad && !dupe) {
StatAdd(&msgs.Received, 1L);
time(&msgs.LastRcvd);
msgs.LastRcvd = time(NULL);
StatAdd(&mgroup.MsgsRcvd, 1L);
time(&mgroup.LastDate);
mgroup.LastDate = time(NULL);
UpdateMsgs();
}

View File

@ -66,7 +66,7 @@ int storenet(faddr *f, faddr *t, time_t mdate, int flags, char *Subj, char *msgi
if (SearchNetBoard(t->zone, t->net)) {
StatAdd(&msgs.Received, 1L);
time(&msgs.LastRcvd);
msgs.LastRcvd = time(NULL);
UpdateMsgs();
result = Msg_Open(msgs.Base);

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: mbmon/common.c
* $Id$
* Purpose ...............: Common utilities
* Last modification date : 10-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -603,7 +602,7 @@ long gmt_offset(time_t now)
long offset;
if (!now)
time(&now);
now = time(NULL);
ptm = *localtime(&now);
/*

View File

@ -372,7 +372,7 @@ void show_date(int fg, int bg, int y, int x)
time_t now;
char *p;
time(&now);
now = time(NULL);
if (now != lasttime) {
lasttime = now;
set_color(LIGHTGREEN, BLUE);

View File

@ -100,7 +100,7 @@ void Good_Bye(int onsig)
}
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBSEBBS finished in %s", t_elapsed(t_start, t_end));
/*

View File

@ -338,7 +338,7 @@ void Download(void)
* Wait a while before download
*/
sleep(2);
time(&ElapstimeStart);
ElapstimeStart = time(NULL);
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s ./tag/*", sProtDn);
@ -366,7 +366,7 @@ void Download(void)
fflush(stdout);
fflush(stdin);
free(temp);
time(&ElapstimeFin);
ElapstimeFin = time(NULL);
/*
* Get time from Before Download and After Download to get
@ -414,7 +414,7 @@ void Download(void)
}
Size += file.Size;
file.TimesDL++;
time(&file.LastDL);
file.LastDL = time(NULL);
fseek(fp, - sizeof(file), SEEK_CUR);
fwrite(&file, sizeof(file), 1, fp);
fclose(fp);
@ -1117,7 +1117,7 @@ int Upload()
fflush(stdout);
fflush(stdin);
sleep(2);
time(&ElapstimeStart);
ElapstimeStart = time(NULL);
/*
* Get the file(s). Set the Client/Server time to 2 hours.
@ -1139,7 +1139,7 @@ int Upload()
printf("\n\n\n");
fflush(stdout);
fflush(stdin);
time(&ElapstimeFin);
ElapstimeFin = time(NULL);
/*
* Get time from Before Upload and After Upload to get
@ -1287,7 +1287,7 @@ int DownloadDirect(char *Name, int Wait)
* Wait a while before download
*/
sleep(2);
time(&ElapstimeStart);
ElapstimeStart = time(NULL);
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s %s", sProtDn, symFrom);
@ -1315,7 +1315,7 @@ int DownloadDirect(char *Name, int Wait)
fflush(stdout);
fflush(stdin);
free(temp);
time(&ElapstimeFin);
ElapstimeFin = time(NULL);
/*
* Get time from Before Download and After Download to get
@ -1656,7 +1656,7 @@ int Upload_Home()
fflush(stdout);
fflush(stdin);
sleep(2);
time(&ElapstimeStart);
ElapstimeStart = time(NULL);
/*
* Get the file(s). Set the Client/Server time to 2 hours.
@ -1678,7 +1678,7 @@ int Upload_Home()
printf("\n\n\n");
fflush(stdout);
fflush(stdin);
time(&ElapstimeFin);
ElapstimeFin = time(NULL);
/*
* Get time from Before Upload and After Upload to get

View File

@ -340,7 +340,7 @@ char *GLCdateyy()
static char GLcdateyy[15];
char ntime[15];
time(&Time_Now);
Time_Now = time(NULL);
l_date = localtime(&Time_Now);
sprintf(GLcdateyy,"%02d-",

View File

@ -91,7 +91,7 @@ void die(int onsig)
WriteError("Terminated with error %d", onsig);
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBALL finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) {
@ -138,7 +138,7 @@ int main(int argc, char **argv)
InitConfig();
TermInit(1);
time(&t_start);
t_start = time(NULL);
umask(000);
/*

View File

@ -245,7 +245,7 @@ char *ttime2()
time_t Time_Now;
static char Ttime2[9];
time(&Time_Now);
Time_Now = time(NULL);
l_date = localtime(&Time_Now);
sprintf(Ttime2, "%02d:%02d", l_date->tm_hour,l_date->tm_min);

View File

@ -97,12 +97,11 @@ int main(int argc, char **argv)
/*
* Set local time and statistic indexes.
*/
time(&Time_Now);
time(&t_start);
Time_Now = t_start = time(NULL);
l_date = localtime(&Time_Now);
Diw = l_date->tm_wday;
Miy = l_date->tm_mon;
time(&ltime);
ltime = time(NULL);
/*
* Initialize this client with the server. We don't know

View File

@ -376,7 +376,7 @@ static void check_password(const struct passwd *pw)
exp_status = isexpired(pw);
#endif
time(&now);
now = time(NULL);
#ifdef SHADOW_PASSWORD
/*

View File

@ -79,12 +79,11 @@ int main(int argc, char **argv)
/*
* Set local time and statistic indexes.
*/
time(&Time_Now);
time(&t_start);
Time_Now = t_start = time(NULL);
l_date = localtime(&Time_Now);
Diw = l_date->tm_wday;
Miy = l_date->tm_mon;
time(&ltime);
ltime = time(NULL);
/*
* Initialize this client with the server.

View File

@ -1,6 +1,6 @@
/*****************************************************************************
*
* $id$
* $Id$
* Purpose ...............: Change BBS status
*
*****************************************************************************
@ -91,7 +91,7 @@ void die(int onsig)
printf("\n");
}
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBSTAT finished in %s", t_elapsed(t_start, t_end));
ExitClient(onsig);
@ -114,7 +114,7 @@ int main(int argc, char **argv)
#endif
InitConfig();
TermInit(1);
time(&t_start);
t_start = time(NULL);
/*
* Catch or ignore signals

View File

@ -61,7 +61,7 @@ int main(int argc, char **argv)
Days = 0;
Level = 0;
time(&t_start);
t_start = time(NULL);
if (argc < 2)
Help();
@ -113,7 +113,7 @@ int main(int argc, char **argv)
UserPack(Days, Level, pack);
umask(oldmask);
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBUSER finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet)

View File

@ -93,7 +93,7 @@ int ChkFiles()
WriteError("$ChkFiles: Can't create %s", sDataFile);
else {
memset((char *)&SYSINFO, 0, sizeof(SYSINFO));
time(&Now);
Now = time(NULL);
SYSINFO.StartDate = Now;
rewind(pCallerLog);
@ -223,7 +223,7 @@ char *GLCdate()
{
static char GLcdate[15];
time(&Time_Now);
Time_Now = time(NULL);
l_date = localtime(&Time_Now);
sprintf(GLcdate,"%02d-", l_date->tm_mday);

View File

@ -62,7 +62,7 @@ char *rfcdate(time_t now)
long offset;
if (!now)
time(&now);
now = time(NULL);
ptm = *localtime(&now);
/*
@ -229,7 +229,7 @@ void Add_Headkludges(faddr *dest, int IsReply)
sprintf(temp, "\001PID: MBSE-BBS %s", VERSION);
MsgText_Add2(temp);
(void)time(&tt);
tt = time(NULL);
sprintf(temp, "\001TZUTC: %s", gmtoffset(tt));
MsgText_Add2(temp);
free(temp);

View File

@ -557,7 +557,7 @@ void Fast_Bye(int onsig)
char *temp;
time_t t_end;
time(&t_end);
t_end = time(NULL);
Syslog(' ', "MBNEWUSR finished in %s", t_elapsed(t_start, t_end));
socket_shutdown(mypid);

View File

@ -1113,7 +1113,7 @@ void OLR_Upload(void)
fflush(stdout);
fflush(stdin);
sleep(2);
time(&ElapstimeStart);
ElapstimeStart = time(NULL);
/*
* Get the file
@ -1130,7 +1130,7 @@ void OLR_Upload(void)
printf("\n");
fflush(stdout);
fflush(stdin);
time(&ElapstimeFin);
ElapstimeFin = time(NULL);
/*
* Get the upload time.

View File

@ -93,7 +93,7 @@ char *crypt_make_salt(void)
static unsigned long x;
static char result[3];
time(&now);
now = time(NULL);
x += now + getpid() + clock();
result[0] = i64c(((x >> 18) ^ (x >> 6)) & 077);
result[1] = i64c(((x >> 12) ^ x) & 077);

View File

@ -83,7 +83,7 @@ void TimeCheck(void)
time_t Now;
int Elapsed;
time(&Now);
Now = time(NULL);
/*
* Update the global string for the menu prompt

View File

@ -45,7 +45,7 @@ void TimeStats()
{
char Logdate[15];
time(&Time_Now);
Time_Now = time(NULL);
l_date = localtime(&Time_Now);
sprintf(Logdate,"%02d-%s %02d:%02d:%02d", l_date->tm_mday, GetMonth(l_date->tm_mon+1),
l_date->tm_hour, l_date->tm_min, l_date->tm_sec);

View File

@ -408,7 +408,7 @@ void user()
Syslog('+', "User successfully logged into BBS");
Syslog('+', "Level %d (%s), %d mins. left, port %s",
usrconfig.Security.level, LIMIT.Description, usrconfig.iTimeLeft, pTTY);
time(&Time2Go);
Time2Go = time(NULL);
Time2Go += usrconfig.iTimeLeft * 60;
iUserTimeLeft = exitinfo.iTimeLeft;

View File

@ -198,7 +198,7 @@ int AppendFGroup(void)
sprintf(ffile, "%s/etc/fgroups.temp", getenv("MBSE_ROOT"));
if ((fil = fopen(ffile, "a")) != NULL) {
memset(&fgroup, 0, sizeof(fgroup));
time(&fgroup.StartDate);
fgroup.StartDate = time(NULL);
fgroup.DivideCost = TRUE;
fwrite(&fgroup, sizeof(fgroup), 1, fil);
fclose(fil);

View File

@ -1672,7 +1672,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Machine type %s\n", utsbuf.machine);
}
fprintf(fp, " MBSE_ROOT %s\n", getenv("MBSE_ROOT"));
time(&now);
now = time(NULL);
fprintf(fp, " Date created %s", ctime(&now));
addtoc(fp, toc, 1, 2, page, (char *)"System fidonet addresses");

View File

@ -198,7 +198,7 @@ int AppendMGroup(void)
sprintf(ffile, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
if ((fil = fopen(ffile, "a")) != NULL) {
memset(&mgroup, 0, sizeof(mgroup));
time(&mgroup.StartDate);
mgroup.StartDate = time(NULL);
fwrite(&mgroup, sizeof(mgroup), 1, fil);
fclose(fil);
MGrpUpdated = 1;

View File

@ -486,7 +486,7 @@ void ImportOneline(void)
return;
}
time(&Time);
Time = time(NULL);
l_date = localtime(&Time);
sprintf(buf, "%02d-%02d-%04d", l_date->tm_mday, l_date->tm_mon+1, l_date->tm_year+1900);

View File

@ -94,7 +94,7 @@ void show_date(int fg, int bg, int y, int x)
time_t now;
char *p;
time(&now);
now = time(NULL);
if (now != lasttime) {
lasttime = now;
set_color(LIGHTGREEN, BLUE);