Lost of changes

This commit is contained in:
Michiel Broek
2004-01-25 10:57:35 +00:00
parent 1382701bd8
commit 5a0e317f23
41 changed files with 762 additions and 604 deletions

View File

@@ -40,7 +40,7 @@ OBJS = ${CLCOMM_OBJS} ${COMMON_OBJS} ${DBASE_OBJS} ${MSGBASE_OBJS} ${MBINET_OBJ
${DIESEL_OBJS} ${NODELIST_OBJS}
HDRS = ${CLCOMM_HDRS} ${COMMON_HDRS} ${DBASE_HDRS} ${MSGBASE_HDRS} ${MBINET_HDRS} \
${DIESEL_HDRS} ${NODELIST_HDRS} ${OTHER_HDRS}
OTHER = Makefile README ftscprod.007 mkprod.awk \
OTHER = Makefile README ftscprod.008 mkprod.awk \
README.diesel README.macro Diesel.doc nodelist.conf
TARGET = libclcomm.a libcommon.a libdbase.a libmsgbase.a libmbinet.a libdiesel.a \
libnodelist.a
@@ -137,7 +137,7 @@ proglock.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/rec
dostran.o: ../config.h libs.h structs.h users.h records.h common.h
ftnmsg.o: ../config.h libs.h structs.h common.h clcomm.h
mbfile.o: ../config.h libs.h structs.h clcomm.h common.h
nodelock.o: ../config.h libs.h structs.h clcomm.h common.h
nodelock.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h
rawio.o: ../config.h libs.h structs.h common.h mberrors.h
strcasestr.o: ../config.h libs.h
execute.o: ../config.h libs.h structs.h clcomm.h mberrors.h common.h
@@ -160,7 +160,7 @@ dbmsgs.o: ../config.h libs.h structs.h users.h records.h clcomm.h dbcfg.h dbmsgs
dbnode.o: ../config.h libs.h structs.h common.h users.h records.h clcomm.h dbcfg.h dbnode.h
dbtic.o: ../config.h libs.h structs.h users.h records.h clcomm.h dbcfg.h dbtic.h
dbuser.o: ../config.h libs.h structs.h users.h records.h dbcfg.h dbuser.h
jammsg.o: ../config.h libs.h clcomm.h msgtext.h msg.h jam.h jammsg.h
jammsg.o: ../config.h libs.h clcomm.h msgtext.h structs.h common.h msg.h jam.h jammsg.h
msg.o: ../config.h libs.h msgtext.h msg.h clcomm.h structs.h common.h jammsg.h
msgtext.o: ../config.h libs.h msgtext.h msg.h
nntp.o: ../config.h libs.h structs.h users.h records.h clcomm.h mbinet.h

View File

@@ -512,6 +512,8 @@ void gpt_resettimers(void); /* Reset all timers */
int gpt_settimer(int, int); /* Set timer no to time */
int gpt_expired(int); /* Is timer expired */
int gpt_running(int); /* Is timer running */
int msleep(int); /* Milliseconds timer */
#endif

View File

@@ -140,7 +140,9 @@ int execute(char *cmd, char *file, char *pkt, char *in, char *out, char *err)
#ifdef __linux__
sync();
#endif
msleep(100);
rc = _execute(cmd, file, pkt, in, out, err);
msleep(100);
#ifdef __linux
sync();
#endif
@@ -215,7 +217,9 @@ int execsh(char *cmd, char *in, char *out, char *err)
#ifdef __linux__
sync();
#endif
msleep(100);
rc = _execsh(cmd, in, out, err);
msleep(100);
#ifdef __linux__
sync();
#endif

View File

@@ -10,7 +10,7 @@
* MBSE BBS and utilities.
*
*****************************************************************************
* Copyright (C) 1997-2003
* Copyright (C) 1997-2004
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -38,10 +38,13 @@
#include "libs.h"
#include "clcomm.h"
#include "msgtext.h"
#include "structs.h"
#include "common.h"
#include "msg.h"
#include "jam.h"
#include "jammsg.h"
#define MAX_TEXT 2048
int fdHdr = -1;
@@ -400,7 +403,7 @@ int JAM_Lock(unsigned long ulTimeout)
WriteError("JAM messagebase is locked by pid %d", fl.l_pid);
return FALSE;
}
usleep(250000);
msleep(250);
Syslog('m', "JAM messagebase lock attempt %d", Tries);
}

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Basic File I/O
*
*****************************************************************************
* Copyright (C) 1997-2003
* Copyright (C) 1997-2004
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -193,8 +193,6 @@ long file_crc(char *path, int slow)
do {
bread = fread(line, 1, 32768, fp);
crc = upd_crc32(line, crc, bread);
if (slow)
usleep(1);
Nopper(); // For large files on slow systems.
} while (bread > 0);

View File

@@ -381,7 +381,7 @@ int Msg_Link(char *Path, int do_quiet, int slow_util)
i++;
if (slow_util && do_quiet && ((i % 5) == 0))
usleep(1);
msleep(1);
if (((i % 10) == 0) && (!do_quiet)) {
printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
@@ -414,7 +414,7 @@ int Msg_Link(char *Path, int do_quiet, int slow_util)
}
if (slow_util && do_quiet && ((i % 5) == 0))
usleep(1);
msleep(1);
if (((i % 10) == 0) && (!do_quiet)) {
printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Raw I/O routines.
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2004
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -238,7 +238,7 @@ int Waitchar(unsigned char *ch, int wtime)
rc = read(ttyfd, ch, 1);
if (rc == 1)
return rc;
usleep(10000);
msleep(10);
}
return rc;
}

View File

@@ -4,7 +4,7 @@
* Purpose ...............: General Purpose Timers
*
*****************************************************************************
* Copyright (C) 1997-2003
* Copyright (C) 1997-2004
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -127,3 +127,40 @@ int gpt_running(int tno)
}
/*
* Milliseconds timer, returns 0 on success.
*/
int msleep(int msecs)
{
int rc;
struct timespec req, rem;
rem.tv_sec = 0;
rem.tv_nsec = 0;
req.tv_sec = msecs / 1000;
req.tv_nsec = (msecs % 1000) * 1000000;
while (TRUE) {
rc = nanosleep(&req, &rem);
if (rc == 0)
break;
if ((errno == EINVAL) || (errno == EFAULT)) {
WriteError("$msleep(%d)", msecs);
break;
}
/*
* Error was EINTR, run timer again to complete.
*/
req.tv_sec = rem.tv_sec;
req.tv_nsec = rem.tv_nsec;
rem.tv_sec = 0;
rem.tv_nsec = 0;
}
return rc;
}