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.
This commit is contained in:
parent
8849f45ad7
commit
92714255b3
|
@ -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 = req;
|
||||||
devc->last_req_pending = TRUE;
|
devc->last_req_pending = TRUE;
|
||||||
|
|
||||||
if (serial_write(serial, buf, len) == -1) {
|
if (serial_write_blocking(serial, buf, len) < 0) {
|
||||||
sr_err("Unable to send request: %d %s.",
|
sr_err("Unable to send request.");
|
||||||
errno, strerror(errno));
|
|
||||||
devc->last_req_pending = FALSE;
|
devc->last_req_pending = FALSE;
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue