Upgrade CVS to 0.33.18 current

This commit is contained in:
Michiel Broek
2001-08-25 19:53:11 +00:00
parent 2ff822f657
commit e90745a139
111 changed files with 3126 additions and 3121 deletions

View File

@@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
AWK = @AWK@
CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@
GROUP = @GROUP@
GZIP = @GZIP@
@@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = .
@@ -138,6 +138,20 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
DEP_FILES = .deps/attach.P .deps/batchrd.P .deps/charconv.P \
.deps/charconv_hz.P .deps/charconv_jp.P .deps/charconv_utf.P \
.deps/charset.P .deps/clcomm.P .deps/client.P .deps/crc.P .deps/dbcfg.P \
.deps/dbdupe.P .deps/dbftn.P .deps/dbmsgs.P .deps/dbnode.P \
.deps/dbtic.P .deps/dbuser.P .deps/dostran.P .deps/execute.P \
.deps/expipe.P .deps/faddr.P .deps/falists.P .deps/ftn.P .deps/ftnmsg.P \
.deps/ftscprod.P .deps/getheader.P .deps/gmtoffset.P .deps/hdr.P \
.deps/jammsg.P .deps/mbfile.P .deps/memwatch.P .deps/mime.P .deps/msg.P \
.deps/msgflags.P .deps/msgtext.P .deps/nntp.P .deps/nodelist.P \
.deps/nodelock.P .deps/noderecord.P .deps/packet.P .deps/parsedate.P \
.deps/pktname.P .deps/pop3.P .deps/rawio.P .deps/rfcaddr.P \
.deps/rfcdate.P .deps/rfcmsg.P .deps/semafore.P .deps/signame.P \
.deps/smtp.P .deps/strcasestr.P .deps/strutil.P .deps/term.P \
.deps/unpacker.P
SOURCES = $(libclcomm_a_SOURCES) $(libcommon_a_SOURCES) $(libdbase_a_SOURCES) $(libmsgbase_a_SOURCES) $(libmbinet_a_SOURCES) $(libmemwatch_a_SOURCES)
OBJECTS = $(libclcomm_a_OBJECTS) $(libcommon_a_OBJECTS) $(libdbase_a_OBJECTS) $(libmsgbase_a_OBJECTS) $(libmbinet_a_OBJECTS) $(libmemwatch_a_OBJECTS)
@@ -145,9 +159,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -161,9 +175,6 @@ distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
@@ -304,6 +315,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = lib
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu lib/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
@@ -324,101 +340,38 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
attach.o: attach.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h common.h
batchrd.o: batchrd.c libs.h ../config.h memwatch.h structs.h clcomm.h \
common.h
charconv.o: charconv.c libs.h ../config.h memwatch.h structs.h records.h \
common.h clcomm.h
charconv_hz.o: charconv_hz.c libs.h ../config.h memwatch.h structs.h \
common.h clcomm.h
charconv_jp.o: charconv_jp.c libs.h ../config.h memwatch.h structs.h \
common.h
charconv_utf.o: charconv_utf.c libs.h ../config.h memwatch.h structs.h \
common.h
charset.o: charset.c libs.h ../config.h memwatch.h structs.h common.h \
clcomm.h
clcomm.o: clcomm.c libs.h ../config.h memwatch.h clcomm.h
client.o: client.c libs.h ../config.h memwatch.h clcomm.h
crc.o: crc.c libs.h ../config.h memwatch.h clcomm.h
dbcfg.o: dbcfg.c libs.h ../config.h memwatch.h mbse.h structs.h \
records.h dbcfg.h
dbdupe.o: dbdupe.c libs.h ../config.h memwatch.h structs.h clcomm.h \
dbdupe.h
dbftn.o: dbftn.c libs.h ../config.h memwatch.h structs.h records.h \
dbcfg.h dbftn.h
dbmsgs.o: dbmsgs.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h dbcfg.h dbmsgs.h
dbnode.o: dbnode.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h dbcfg.h dbnode.h
dbtic.o: dbtic.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h dbcfg.h dbtic.h
dbuser.o: dbuser.c libs.h ../config.h memwatch.h structs.h records.h \
dbcfg.h dbuser.h
dostran.o: dostran.c libs.h ../config.h memwatch.h structs.h records.h \
common.h
execute.o: execute.c libs.h ../config.h memwatch.h structs.h clcomm.h \
common.h
expipe.o: expipe.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h common.h
faddr.o: faddr.c libs.h ../config.h memwatch.h structs.h common.h
falists.o: falists.c libs.h ../config.h memwatch.h structs.h clcomm.h \
common.h
ftn.o: ftn.c libs.h ../config.h memwatch.h structs.h records.h clcomm.h \
dbftn.h common.h
ftnmsg.o: ftnmsg.c libs.h ../config.h memwatch.h structs.h common.h \
clcomm.h
ftscprod.o: ftscprod.c libs.h ../config.h memwatch.h structs.h common.h
getheader.o: getheader.c libs.h ../config.h memwatch.h structs.h \
records.h clcomm.h common.h
gmtoffset.o: gmtoffset.c libs.h ../config.h memwatch.h structs.h \
common.h
hdr.o: hdr.c libs.h ../config.h memwatch.h structs.h common.h
jammsg.o: jammsg.c libs.h ../config.h memwatch.h clcomm.h msgtext.h \
msg.h jam.h jamsys.h jammsg.h
mbfile.o: mbfile.c libs.h ../config.h memwatch.h structs.h clcomm.h \
common.h
memwatch.o: memwatch.c ../config.h libs.h memwatch.h memwatch.h
mime.o: mime.c libs.h ../config.h memwatch.h structs.h clcomm.h common.h
msg.o: msg.c libs.h ../config.h memwatch.h msgtext.h msg.h jammsg.h
msgflags.o: msgflags.c libs.h ../config.h memwatch.h structs.h clcomm.h \
common.h
msgtext.o: msgtext.c libs.h ../config.h memwatch.h msgtext.h msg.h
nntp.o: nntp.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h mbinet.h
nodelist.o: nodelist.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h common.h
nodelock.o: nodelock.c libs.h ../config.h memwatch.h structs.h clcomm.h \
common.h
noderecord.o: noderecord.c libs.h ../config.h memwatch.h structs.h \
records.h dbnode.h common.h
packet.o: packet.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h common.h dbnode.h
parsedate.o: parsedate.c libs.h ../config.h memwatch.h structs.h \
common.h
pktname.o: pktname.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h common.h
pop3.o: pop3.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h mbinet.h
rawio.o: rawio.c libs.h ../config.h memwatch.h structs.h common.h
rfcaddr.o: rfcaddr.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h common.h
rfcdate.o: rfcdate.c libs.h ../config.h memwatch.h structs.h common.h \
clcomm.h
rfcmsg.o: rfcmsg.c libs.h ../config.h memwatch.h structs.h records.h \
common.h clcomm.h
semafore.o: semafore.c libs.h ../config.h memwatch.h structs.h clcomm.h \
common.h
signame.o: signame.c libs.h ../config.h memwatch.h clcomm.h
smtp.o: smtp.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h mbinet.h
strcasestr.o: strcasestr.c libs.h ../config.h memwatch.h
strutil.o: strutil.c libs.h ../config.h memwatch.h structs.h common.h
term.o: term.c libs.h ../config.h memwatch.h structs.h ansi.h records.h \
common.h
unpacker.o: unpacker.c libs.h ../config.h memwatch.h structs.h records.h \
clcomm.h common.h
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-recursive
dvi-am:
@@ -457,23 +410,25 @@ distclean-generic:
maintainer-clean-generic:
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-generic
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-tags distclean-generic clean-am
distclean-tags distclean-depend distclean-generic \
clean-am
distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-generic distclean-am
maintainer-clean-depend maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -488,12 +443,14 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
ftscprod.c: ftscprod.???

View File

@@ -351,8 +351,8 @@ extern struct _pkey {
extern char SigName[32][16];
int ttyfd; /* Filedescriptor for raw mode */
struct termio tbuf, tbufsav; /* Structure for raw mode */
int ttyfd; /* Filedescriptor for raw mode */
struct termios tbufs, tbufsavs; /* Structure for raw mode */
@@ -399,7 +399,7 @@ fidoaddr str2aka(char *addr);
* From falists.c
*/
void tidy_falist(fa_list **);
void fill_list(fa_list **,char *,fa_list **, int);
void fill_list(fa_list **,char *,fa_list **);
void fill_path(fa_list **,char *);
void sort_list(fa_list **);
void uniq_list(fa_list **);

View File

@@ -2,7 +2,7 @@
*
* File ..................: falists.c
* Purpose ...............: SEEN-BY and PATH lists
* Last modification date : 25-Mar-2001
* Last modification date : 31-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -76,7 +76,7 @@ int in_list(faddr *addr, fa_list **fap, int fourd)
void fill_list(fa_list **fap, char *str, fa_list **omit, int force)
void fill_list(fa_list **fap, char *str, fa_list **omit)
{
fa_list *tmp;
faddr *ta;
@@ -109,7 +109,6 @@ void fill_list(fa_list **fap, char *str, fa_list **omit, int force)
tmp = (fa_list *)malloc(sizeof(fa_list));
tmp->next = *fap;
tmp->addr = ta;
tmp->force = force;
*fap = tmp;
}
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: jammsg.c
* Purpose ...............: JAM message base functions
* Last modification date : 23-Jun-2001
* Last modification date : 03-Aug-2001
*
*****************************************************************************
*
@@ -363,8 +363,6 @@ unsigned long JAM_Highest(void)
int JAM_Lock(unsigned long ulTimeout)
{
// char *File;
// int fd = -1, Tries = 0;
int Tries = 0;
struct flock fl;
@@ -383,23 +381,6 @@ int JAM_Lock(unsigned long ulTimeout)
usleep(250000);
Syslog('m', "JAM messagebase lock attempt %d", Tries);
}
// File = calloc(PATH_MAX, sizeof(char));
// sprintf(File, "%s%s", BaseName, ".LCK");
// while ((fd = creat(File, 0)) == -1 && errno == EACCES) {
// if (++Tries >= ulTimeout) {
// free(File);
// return FALSE;
// }
// sleep(1);
// }
// free(File);
// if (fd == -1)
// return FALSE;
// close(fd);
return TRUE;
}
@@ -1301,15 +1282,6 @@ void JAM_UnLock(void)
if (fcntl(fdHdr, F_SETLK, &fl)) {
WriteError("$Can't unlock JAM message base");
}
// char *File;
// File = calloc(PATH_MAX, sizeof(char));
// sprintf(File, "%s%s", BaseName, ".LCK");
// if (unlink(File) == -1)
// WriteError("jammsg: unlock error");
// free(File);
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: libs.h
* Purpose ...............: Libraries include list
* Last modification date : 23-May-2001
* Last modification date : 05-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -55,7 +55,7 @@
#include <errno.h>
#include <sys/fcntl.h>
#include <unistd.h>
#include <termio.h>
#include <termios.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <dirent.h>
@@ -63,9 +63,13 @@
#include <stdarg.h>
#include <pwd.h>
#include <netdb.h>
#ifdef SHADOW_PASSWORD
#include <shadow.h>
#endif
#include <sys/ioctl.h>
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/utsname.h>

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfile
* Purpose ...............: Basic File I/O
* Last modification date : 05-Jul-2001
* Last modification date : 12-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -255,14 +255,22 @@ int mkdirs(char *name)
/*
* Check free diskspace on most filesystems. Exclude check on floppyies,
* CD's and /boot partition. The amount of needed space is given in MBytes.
* Currently only Linux is supported.
*/
int diskfree(int needed)
{
#ifdef __linux__
char *mtab, *dev, *fs, *type;
FILE *fp;
struct statfs sfs;
int RetVal = TRUE;
unsigned long temp;
#endif
#ifdef __linux__
if (! needed)
return TRUE;
@@ -283,7 +291,8 @@ int diskfree(int needed)
*/
if (strncmp((char *)"/dev/fd", dev, 7) && strncmp((char *)"/boot", fs, 5) &&
(!strncmp((char *)"ext2", type, 4) || !strncmp((char *)"reiserfs", type, 8) ||
!strncmp((char *)"vfat", type, 4) || !strncmp((char *)"msdos", type, 5))) {
!strncmp((char *)"ufs", type, 3) ||
!strncmp((char *)"vfat", type, 4) || !strncmp((char *)"msdos", type, 5))) {
if (statfs(fs, &sfs) == 0) {
temp = (unsigned long)(sfs.f_bsize / 512L);
if (((unsigned long)(sfs.f_bavail * temp) / 2048L) < needed) {
@@ -299,6 +308,9 @@ int diskfree(int needed)
free(mtab);
return RetVal;
#else /* ifdef __linux__ */
return TRUE; /* Assume enough */
#endif
}

View File

@@ -1414,10 +1414,10 @@ int GetTimeInfo(TIMEINFO *Now)
#if defined(HAVE_GETTIMEOFDAY)
struct timeval tv;
#endif /* defined(HAVE_GETTIMEOFDAY) */
#if !defined(HAVE_TM_GMTOFF)
#if !defined(HAVE_TM_ZONE)
struct tm local;
struct tm gmt;
#endif /* !defined(HAVE_TM_GMTOFF) */
#endif /* !defined(HAVE_TM_ZONE) */
/* Get the basic time. */
#if defined(HAVE_GETTIMEOFDAY)
@@ -1436,7 +1436,7 @@ int GetTimeInfo(TIMEINFO *Now)
if ((tm = localtime(&Now->time)) == NULL)
return -1;
secondsUntilNextHour = 60 * (60 - tm->tm_min) - tm->tm_sec;
#if !defined(HAVE_TM_GMTOFF)
#if !defined(HAVE_TM_ZONE)
/* To get the timezone, compare localtime with GMT. */
local = *tm;
if ((tm = gmtime(&Now->time)) == NULL)
@@ -1458,7 +1458,7 @@ int GetTimeInfo(TIMEINFO *Now)
LastTzone += gmt.tm_min - local.tm_min;
#else
LastTzone = (0 - tm->tm_gmtoff) / 60;
#endif /* defined(HAVE_TM_GMTOFF) */
#endif /* defined(HAVE_TM_ZONE) */
NextHour = Now->time + secondsUntilNextHour;
}
Now->tzone = LastTzone;
@@ -1739,7 +1739,7 @@ time_t parsedate(char *p, TIMEINFO *now)
yyYear = tm->tm_year + 1900;
yyMonth = tm->tm_mon + 1;
yyDay = tm->tm_mday;
#ifdef HAVE_TM_GMTOFF
#ifdef HAVE_TM_ZONE
yyTimezone = tm->tm_gmtoff/60;
#else
yyTimezone = timezone/60;

View File

@@ -2,10 +2,10 @@
*
* File ..................: rawio.c
* Purpose ...............: Raw I/O routines.
* Last modification date : 18-Dec-1999
* Last modification date : 07-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-1999
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -42,26 +42,39 @@ int rawset = FALSE;
*/
void Setraw()
{
if (ioctl(ttyfd, TCGETA, &tbuf) == -1) {
perror("TCGETA Failed");
exit(1); /* ERROR - could not set get tty ioctl */
int rc;
// if (ioctl(ttyfd, TCGETA, &tbuf) == -1) {
// perror("TCGETA Failed");
// exit(1); /* ERROR - could not set get tty ioctl */
// }
if ((rc = tcgetattr(ttyfd, &tbufs))) {
perror("");
printf("$tcgetattr(0, save) return %d\n", rc);
exit(1);
}
tbufsav = tbuf;
tbuf.c_iflag &= ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON );
/*
* Map CRNL modes strip control characters and flow control
*/
tbuf.c_oflag &= ~OPOST; /* Don't do ouput character translation */
tbuf.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */
tbuf.c_cc[VMIN] = 1; /* Receive 1 character at a time */
tbuf.c_cc[VTIME] = 0; /* No time limit per character */
tbufsavs = tbufs;
tbufs.c_iflag &= ~(INLCR | ICRNL | ISTRIP | IXON ); /* IUCLC removed for FreeBSD */
/*
* Map CRNL modes strip control characters and flow control
*/
tbufs.c_oflag &= ~OPOST; /* Don't do ouput character translation */
tbufs.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */
tbufs.c_cc[VMIN] = 1; /* Receive 1 character at a time */
tbufs.c_cc[VTIME] = 0; /* No time limit per character */
if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) {
perror("TCSETAF failed");
exit(1); /* ERROR - could not set tty ioctl */
if ((rc = tcsetattr(ttyfd, TCSADRAIN, &tbufs))) {
perror("");
printf("$tcsetattr(%d, TCSADRAIN, raw) return %d\n", ttyfd, rc);
exit(1);
}
// if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) {
// perror("TCSETAF failed");
// exit(1); /* ERROR - could not set tty ioctl */
// }
rawset = TRUE;
}
@@ -72,13 +85,20 @@ void Setraw()
*/
void Unsetraw()
{
int rc;
/*
* Only unset the mode if it is set to raw mode
*/
if (rawset == TRUE) {
if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) {
perror("TCSETAF Normal Failed");
exit(1); /* ERROR - could not save original tty ioctl */
// if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) {
// perror("TCSETAF Normal Failed");
// exit(1); /* ERROR - could not save original tty ioctl */
// }
if ((rc = tcsetattr(ttyfd, TCSAFLUSH, &tbufsavs))) {
perror("");
printf("$tcsetattr(%d, TCSAFLUSH, save) return %d\n", ttyfd, rc);
exit(1);
}
}
rawset = FALSE;
@@ -114,14 +134,17 @@ unsigned char Getone()
*/
int Speed(void)
{
int mspeed;
struct termio ttyhold;
// int mspeed;
// struct termio ttyhold;
speed_t mspeed;
static int baud[16] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400};
// static int baud[16] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400};
ioctl(0, TCGETA, &ttyhold);
mspeed = baud[ttyhold.c_cflag & 017];
ioctl(0, TCSETAF, &ttyhold);
// ioctl(0, TCGETA, &ttyhold);
// mspeed = baud[ttyhold.c_cflag & 017];
// ioctl(0, TCSETAF, &ttyhold);
mspeed = cfgetospeed(&tbufs);
return(mspeed);
}