From: Martin Ling Date: Sun, 21 Sep 2014 18:12:16 +0000 (+0100) Subject: norma-dmm: Make write call block. X-Git-Tag: libsigrok-0.4.0~947 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8849f45ad71585e8eb3090733c911f6f15cc2a3f;p=libsigrok.git norma-dmm: Make write call block. This call was previously nonblocking, but has no partial write handling. It is called in the scan where it is free to block. --- diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c index c5f95d28..deefceae 100644 --- a/src/hardware/norma-dmm/api.c +++ b/src/hardware/norma-dmm/api.c @@ -129,9 +129,8 @@ static GSList *do_scan(struct sr_dev_driver* drv, GSList *options) nmadmm_requests[NMADMM_REQ_IDN].req_str); g_usleep(150 * 1000); /* Wait a little to allow serial port to settle. */ for (cnt = 0; cnt < 7; cnt++) { - if (serial_write(serial, req, strlen(req)) == -1) { - sr_err("Unable to send identification request: %d %s.", - errno, strerror(errno)); + if (serial_write_blocking(serial, req, strlen(req)) < 0) { + sr_err("Unable to send identification request."); return NULL; } len = BUF_MAX;