From afafbe3ba25fe893536a42aca0bebef933aba5df Mon Sep 17 00:00:00 2001 From: short <> Date: Wed, 27 Feb 2002 22:46:37 +0000 Subject: [PATCH] Fixed hangup on initial run on uClinux (TCSADRAIN -> TCSANOW) Not yet working stack checking (symbol STACKCHECK) +debugging messages --- common/devices/unixserial.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/common/devices/unixserial.c b/common/devices/unixserial.c index ba66941..c98d27f 100644 --- a/common/devices/unixserial.c +++ b/common/devices/unixserial.c @@ -233,19 +233,28 @@ void serial_changespeed(int __fd, int __speed) { } #ifndef SGTTY +#ifdef DEBUG + fprintf(stdout,_("Serial port speed setting: tcgetattr()...\n")); +#endif /* DEBUG */ tcgetattr(__fd, &t); // This is not needed! We set up the speed via cfsetspeed // t.c_cflag &= ~CBAUD; // t.c_cflag |= speed; #ifdef DEBUG + fprintf(stdout,_("Serial port speed setting: cfsetspeed()...\n")); +#endif /* DEBUG */ +#ifdef DEBUG if (cfsetspeed(&t, speed) == -1) fprintf(stdout,_("Serial port speed setting failed\n")); #else (void)cfsetspeed(&t, speed); #endif - tcsetattr(__fd, TCSADRAIN, &t); +#ifdef DEBUG + fprintf(stdout,_("Serial port speed setting: tcsetattr()...\n")); +#endif /* DEBUG */ + tcsetattr(__fd, TCSANOW, &t); #else ioctl(__fd, TIOCGETP, &t); @@ -254,12 +263,16 @@ void serial_changespeed(int __fd, int __speed) { ioctl(__fd, TIOCSETN, &t); #endif +#ifdef DEBUG + fprintf(stdout,_("Serial port speed setting done\n")); +#endif /* DEBUG */ } /* Read from serial device. */ size_t serial_read(int __fd, __ptr_t __buf, size_t __nbytes) { + LIVE; return (read(__fd, __buf, __nbytes)); } @@ -267,6 +280,7 @@ size_t serial_read(int __fd, __ptr_t __buf, size_t __nbytes) { size_t serial_write(int __fd, __const __ptr_t __buf, size_t __n) { + LIVE; return (write(__fd, __buf, __n)); } -- 1.8.3.1