From: Martin Ling Date: Sun, 21 Sep 2014 18:14:05 +0000 (+0100) Subject: norma-dmm: Make serial write call block. X-Git-Tag: libsigrok-0.4.0~946 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=92714255b375d72458ddbac6c632d81f51fb9900;p=libsigrok.git norma-dmm: Make serial write call block. This call is executed from an event handler and was previously nonblocking, but has no partial write handling. It sends a short packet so should be OK to block, most likely the output buffer will be empty anyway. --- diff --git a/src/hardware/norma-dmm/protocol.c b/src/hardware/norma-dmm/protocol.c index 522d88a1..035e991e 100644 --- a/src/hardware/norma-dmm/protocol.c +++ b/src/hardware/norma-dmm/protocol.c @@ -48,9 +48,8 @@ static int nma_send_req(const struct sr_dev_inst *sdi, int req, char *params) devc->last_req = req; devc->last_req_pending = TRUE; - if (serial_write(serial, buf, len) == -1) { - sr_err("Unable to send request: %d %s.", - errno, strerror(errno)); + if (serial_write_blocking(serial, buf, len) < 0) { + sr_err("Unable to send request."); devc->last_req_pending = FALSE; return SR_ERR; }