Fixes a compile failure on MIPS where glibc is missing the "c_ispeed" and "c_ospeed" members in struct termios. Instead of accessing them directly, use the predetermined getter functions, like is done everywhere else in the gpsd source. Run-tested on MIPSel. Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> --- serial.c.gpsd~3.3 2011-12-07 14:38:03.424877170 +0100 +++ serial.c 2011-12-07 14:38:51.077109900 +0100 @@ -594,7 +594,7 @@ void gpsd_close(struct gps_device_t *ses * obscure Linux 2.6 kernel bug that disables threaded * ioctl(TIOCMWAIT) on a device after tcsetattr() is called. */ - if (session->ttyset_old.c_ispeed != session->ttyset.c_ispeed || (session->ttyset_old.c_cflag & CSTOPB) != (session->ttyset.c_cflag & CSTOPB)) { + if (cfgetispeed(&session->ttyset_old) != cfgetispeed(&session->ttyset) || (session->ttyset_old.c_cflag & CSTOPB) != (session->ttyset.c_cflag & CSTOPB)) { /*@ ignore @*/ (void)cfsetispeed(&session->ttyset_old, (speed_t) session->gpsdata.dev.baudrate); Reproducible: Always
Created attachment 295081 [details, diff] fix build on platforms which don't have c_ispeed/c_ospeed in struct termios
fixed in gpsd-3.4 and sent upstream