From: Lutz M?l. <lu...@us...> - 2003-12-11 16:42:35
|
Update of /cvsroot/gphoto/libgphoto2/libgphoto2_port/serial In directory sc8-pr-cvs1:/tmp/cvs-serv6275/serial Modified Files: unix.c Log Message: 2003-12-11 Lutz Mueller <lu...@us...> Patch by Andreas Burmester <a.b...@ha...>: * serial/unix.c: Do not verify the speed change if we set the speed to 0. Index: unix.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/libgphoto2_port/serial/unix.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- unix.c 13 Jul 2003 08:10:06 -0000 1.72 +++ unix.c 11 Dec 2003 16:42:31 -0000 1.73 @@ -888,15 +888,20 @@ * Verify if the speed change has been successful. * This is needed because some Solaris systems just ignore unsupported * speeds (like 115200) instead of complaining. + * + * Only perform the check if we really changed to some speed. */ - if (tcgetattr (dev->pl->fd, &tio)) { - GP_DEBUG ("Error on 'tcgetattr'."); - return (GP_ERROR_IO_SERIAL_SPEED); - } - if ((cfgetispeed (&tio) != speed) || (cfgetospeed (&tio) != speed)) { - GP_DEBUG ("Cannot set baudrate to %d...", - dev->settings.serial.speed); - return (GP_ERROR_NOT_SUPPORTED); + if (speed != B0) { + if (tcgetattr (dev->pl->fd, &tio)) { + GP_DEBUG ("Error on 'tcgetattr'."); + return (GP_ERROR_IO_SERIAL_SPEED); + } + if ((cfgetispeed (&tio) != speed) || + (cfgetospeed (&tio) != speed)) { + GP_DEBUG ("Cannot set baudrate to %d...", + dev->settings.serial.speed); + return (GP_ERROR_NOT_SUPPORTED); + } } #else /* !HAVE_TERMIOS_H */ |