Updated makefiles and a small fix in mbtask

This commit is contained in:
Michiel Broek 2003-12-02 20:32:12 +00:00
parent bc9701f005
commit f52361396c
11 changed files with 24 additions and 51 deletions

View File

@ -5,6 +5,9 @@ v0.39.3 26-Nov-2003
general:
Since this version Posix threads are being used, please let
me know if this doesn't compile on you system.
All Makefiles do not strip the binaries anymore, the binaries
are stripped during make install only. This allows to run the
not yet installed binaries under debuggers.
mbcico:
Dropped binkp CRC support because it will be incompatible with
@ -15,6 +18,7 @@ v0.39.3 26-Nov-2003
mbtask:
The ping function now runs in a separate thread.
Changed some ping timer logic.
v0.39.2 21-Nov-2003 - 26-Nov-2003

View File

@ -51,7 +51,7 @@ int socket_connect(char *user, char *prg, char *city)
{
int s;
static char buf[SS_BUFSIZE];
char tty[18];
static char tty[18];
myname = prg;

View File

@ -56,19 +56,15 @@ install: all
mbcico: ${MBCICO_OBJS} ${LIBS}
${CC} -o mbcico ${MBCICO_OBJS} ${LIBS}
strip mbcico
mbout: ${MBOUT_OBJS} ${LIBS}
${CC} -o mbout ${MBOUT_OBJS} ${LIBS}
strip mbout
mbtelind: ${MBTELIND_OBJS} ${LIBS}
${CC} -o mbtelind ${MBTELIND_OBJS} ${LIBS}
strip mbtelind
mbtelout: ${MBTELOUT_OBJS} ${LIBS}
${CC} -o mbtelout ${MBTELOUT_OBJS} ${LIBS}
strip mbtelout
filelist: Makefile
BASE=`pwd`; \

View File

@ -62,31 +62,24 @@ all: ${TARGET}
mbfido: ${MBFIDO_OBJS} ${MBFIDO_LIBS}
${CC} -o mbfido ${MBFIDO_OBJS} ${LIBS} ${MBFIDO_LIBS}
strip mbfido
mbseq: ${MBSEQ_OBJS} ${MBSEQ_LIBS}
${CC} -o mbseq ${MBSEQ_OBJS} ${LIBS} ${MBSEQ_LIBS}
strip mbseq
mbaff: ${MBAFF_OBJS} ${MBAFF_LIBS}
${CC} -o mbaff ${MBAFF_OBJS} ${LIBS} ${MBAFF_LIBS}
strip mbaff
mbindex: ${MBINDEX_OBJS} ${MBINDEX_LIBS}
${CC} -o mbindex ${MBINDEX_OBJS} ${LIBS} ${MBINDEX_LIBS}
strip mbindex
mbdiff: ${MBDIFF_OBJS} ${MBDIFF_LIBS}
${CC} -o mbdiff ${MBDIFF_OBJS} ${LIBS} ${MBDIFF_LIBS}
strip mbdiff
mbfile: ${MBFILE_OBJS} ${MBFILE_LIBS}
${CC} -o mbfile ${MBFILE_OBJS} ${LIBS} ${MBFILE_LIBS}
strip mbfile
mbmsg: ${MBMSG_OBJS} ${MBMSG_LIBS}
${CC} -o mbmsg ${MBMSG_OBJS} ${LIBS} ${MBMSG_LIBS}
strip mbmsg
clean:
rm -f ${TARGET} *.o *.h~ *.c~ core filelist Makefile.bak

View File

@ -19,7 +19,6 @@ all: mbmon
mbmon: ${OBJS} ${LIBS}
${CC} -o mbmon ${OBJS} ${LIBS}
strip mbmon
clean:
rm -f mbmon *.o *.h~ *.c~ core filelist Makefile.bak

View File

@ -59,31 +59,24 @@ clean:
mbsebbs: ${MBSEBBS_OBJS} ${MBSEBBS_LIBS}
${CC} -o mbsebbs ${MBSEBBS_OBJS} ${LIBS} ${MBSEBBS_LIBS}
strip mbsebbs
mbnewusr: ${MBNEWUSR_OBJS} ${MBNEWUSR_LIBS}
${CC} -o mbnewusr ${MBNEWUSR_OBJS} ${LIBS} ${MBNEWUSR_LIBS}
strip mbnewusr
mball: ${MBALL_OBJS} ${MBALL_LIBS}
${CC} -o mball ${MBALL_OBJS} ${LIBS} ${MBALL_LIBS}
strip mball
mblang: ${MBLANG_OBJS} ${MBLANG_LIBS}
${CC} -o mblang ${MBLANG_OBJS} ${LIBS} ${MBLANG_LIBS}
strip mblang
mbstat: ${MBSTAT_OBJS} ${MBSTAT_LIBS}
${CC} -o mbstat ${MBSTAT_OBJS} ${LIBS} ${MBSTAT_LIBS}
strip mbstat
mbtoberep: ${MBTOBE_OBJS} ${MBTOBE_LIBS}
${CC} -o mbtoberep ${MBTOBE_OBJS} ${LIBS} ${MBTOBE_LIBS}
strip mbtoberep
mbuser: ${MBUSER_OBJS} ${MBUSER_LIBS}
${CC} -o mbuser ${MBUSER_OBJS} ${LIBS} ${MBUSER_LIBS}
strip mbuser
install: all
@if [ "`id -un`" != "root" ] ; then \
@ -96,7 +89,7 @@ install: all
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbstat ${BINDIR}
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbtoberep ${BINDIR}
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 6711 mbuser ${BINDIR}
@rm -f mbuseradd mbpasswd mblogin mbchat
@rm -f mbchat
filelist: Makefile
BASE=`pwd`; \

View File

@ -35,7 +35,6 @@ all: mbsetup
mbsetup: ${OBJS} ${LIBS}
${CC} -o mbsetup ${OBJS} ${LIBS}
strip mbsetup
clean:
rm -f mbsetup *.o *.h~ *.c~ core filelist Makefile.bak

View File

@ -25,7 +25,6 @@ all: mbtask
mbtask: ${OBJS} ${LIBS}
${CC} -o mbtask ${OBJS} ${LIBS}
strip mbtask
clean:
rm -f mbtask *.o *.h~ *.c~ version.* core filelist Makefile.bak
@ -35,15 +34,6 @@ install: all
echo; echo " Must be root to install!"; echo; exit 3; \
fi
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 6711 mbtask ${BINDIR}
@if [ -f ${ETCDIR}/mbsed.conf ]; then \
rm ${ETCDIR}/mbsed.conf ; \
fi
@if [ -f ${ETCDIR}/client.conf ]; then \
rm ${ETCDIR}/client.conf ; \
fi
@if [ -f ${BINDIR}/mbsed ]; then \
rm ${BINDIR}/mbsed ; \
fi
@if [ ! -f ${ETCDIR}/issue ]; then \
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 issue ${ETCDIR} ; \
echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 issue ${ETCDIR}"; \

View File

@ -109,6 +109,7 @@ extern pp_list *pl; /* List of tty ports */
extern int ipmailers; /* TCP/IP mail sessions */
extern int tosswait; /* Toss wait timer */
extern pid_t mypid; /* Pid of daemon */
int T_Shutdown = FALSE; /* Shutdown threads */
@ -651,10 +652,12 @@ void die(int onsig)
int i, count;
signal(onsig, SIG_IGN);
if (onsig == SIGTERM)
if (onsig == SIGTERM) {
Syslog('+', "Starting normal shutdown");
else
T_Shutdown = TRUE;
} else {
Syslog('+', "Abnormal shutdown on signal %s", SigName[onsig]);
}
/*
* First check if there are tasks running, if so try to stop them
@ -1110,7 +1113,6 @@ void scheduler(void)
oldsec = tm->tm_sec;
if (ptimer)
ptimer--;
// check_ping();
}
if (Processing) {

View File

@ -47,6 +47,7 @@ int icmp_errs = 0; /* ICMP error counter */
extern int internet; /* Internet is down */
extern int rescan; /* Master rescan flag */
struct in_addr paddr; /* Current ping address */
extern int T_Shutdown; /* Program shutdown */
@ -332,14 +333,14 @@ void *ping_thread(void)
int rc = 0;
static int pingnr, pingresult[2];
static char pingaddress[41];
static time_t pingtime;
static time_t pingsend;
Syslog('p', "ping_thread: Start");
Syslog('+', "Starting ping thread with pid %d", (int)getpid());
pingresult[1] = pingresult[2] = FALSE;
pingnr = 2;
internet = FALSE;
while (TRUE) {
while (! T_Shutdown) {
/*
* Select new address to ping
@ -367,13 +368,13 @@ void *ping_thread(void)
Syslog('?', "ping: to %s rc=%d", pingaddress, rc);
pingresult[pingnr] = FALSE;
} else {
if (internet)
pingtime = time(NULL) + 20;
else
pingtime = time(NULL) + 10;
pingsend = time(NULL);
while (TRUE) {
if (time(NULL) >= pingtime) {
if (T_Shutdown)
break;
if (time(NULL) >= (pingsend + 20)) {
pingresult[pingnr] = FALSE;
if (icmp_errs < ICMP_MAX_ERRS)
Syslog('?', "ping: to %s timeout", pingaddress);
@ -388,12 +389,12 @@ void *ping_thread(void)
/*
* Reply received.
*/
rc = time(NULL) - (pingtime - 20);
rc = time(NULL) - pingsend;
if (rc > 5)
Syslog('+', "Ping: slow reply after %d seconds", rc);
pingresult[pingnr] = TRUE;
if (rc < 10)
sleep(10 - rc);
if (rc < 20)
sleep(20 - rc);
else
sleep(1);
break;
@ -436,8 +437,7 @@ void *ping_thread(void)
}
}
/* Never reached */
Syslog('p', "ping_thread: End");
Syslog('+', "Ping thread stopped");
pthread_exit(NULL);
}

View File

@ -33,15 +33,12 @@ clean:
mbuseradd: ${MBUSERADD_OBJS}
${CC} -o mbuseradd ${MBUSERADD_OBJS} ${LIBS}
strip mbuseradd
mbpasswd: ${MBPASSWD_OBJS}
${CC} -o mbpasswd ${MBPASSWD_OBJS} ${LIBS}
strip mbpasswd
mblogin: ${MBLOGIN_OBJS}
${CC} -o mblogin ${MBLOGIN_OBJS} ${LIBS}
strip mblogin
install: all
@if [ "`id -un`" != "root" ] ; then \