X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fcommon%2Fscpi_serial.c;h=c56e524ff052dff694481be86c06b72704d6843e;hb=3520422fc761d50830a45a43cd7d34cca589ad1b;hp=3e1492522aea9ee36f8a6264128b54266a5e7a08;hpb=a1ff9c1897262faa3b284ea5bb82593c45de70d0;p=libsigrok.git diff --git a/hardware/common/scpi_serial.c b/hardware/common/scpi_serial.c index 3e149252..c56e524f 100644 --- a/hardware/common/scpi_serial.c +++ b/hardware/common/scpi_serial.c @@ -39,7 +39,13 @@ SR_PRIV int scpi_serial_open(void *priv) { struct sr_serial_dev_inst *serial = priv; - return serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK); + if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) + return SR_ERR; + + if (serial_flush(serial) != SR_OK) + return SR_ERR; + + return SR_OK; } SR_PRIV int scpi_serial_source_add(void *priv, int events, int timeout,