X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fdevices%2Funixserial.c;h=b2e4f6e057f8be35059afaab0ad68cfa9d755b73;hp=ba66941baa70b9386d7ef3e85c3d0a8303bf7b0e;hb=35acc80f23f9f81f3145a686a9c7df4b622b25fe;hpb=c7dcdfd34d2bed9cc64c5c9603e51ef8c8271951 diff --git a/common/devices/unixserial.c b/common/devices/unixserial.c index ba66941..b2e4f6e 100644 --- a/common/devices/unixserial.c +++ b/common/devices/unixserial.c @@ -116,6 +116,7 @@ int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_as if (fd < 0) return fd; +#ifndef UCLINUX /* Allow process/thread to receive SIGIO */ #if !(__unices__) @@ -137,6 +138,7 @@ int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_as return(-1); } } +#endif /* UCLINUX */ /* Initialise the port settings */ @@ -233,19 +235,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 +265,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 +282,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)); }