Honour any error status from serial port calls

The  previous commit  introduced  a regression  that  masks any  error
return from  opening the serial  port used for  PTT when that  port is
different from the CAT serial port.
Hamlib-3.0
Bill Somerville 2015-04-22 22:16:35 +01:00
rodzic de3fccf033
commit cf65505511
1 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -537,15 +537,19 @@ int HAMLIB_API rig_open(RIG *rig)
rs->pttport.pathname);
status = -RIG_EIO;
}
if (rs->pttport.type.ptt == RIG_PTT_SERIAL_DTR
|| rs->pttport.type.ptt == RIG_PTT_SERIAL_RTS)
if (RIG_OK == status
&& (rs->pttport.type.ptt == RIG_PTT_SERIAL_DTR
|| rs->pttport.type.ptt == RIG_PTT_SERIAL_RTS))
{
/* Needed on Linux because the serial port driver sets
RTS/DTR high on open - set both low since we offer no
control of the non-PTT line and low is better than
high */
status = ser_set_dtr(&rs->pttport, 0);
status = ser_set_rts(&rs->pttport, 0);
if (RIG_OK == status)
{
status = ser_set_rts(&rs->pttport, 0);
}
}
}
break;