agilent-dmm: Make serial write call block in send.
This call is executed from an event handler context was previously nonblocking, however there is no handling for a partial write. The output buffer is unlikely to be full and the commands to be sent are short, so it should be OK to make this a blocking call.
This commit is contained in:
parent
485b9ae34d
commit
a5053ddd21
|
@ -140,7 +140,7 @@ static int agdmm_send(const struct sr_dev_inst *sdi, const char *cmd)
|
||||||
strncat(buf, "\r\n", 32);
|
strncat(buf, "\r\n", 32);
|
||||||
else
|
else
|
||||||
strncat(buf, "\n\r\n", 32);
|
strncat(buf, "\n\r\n", 32);
|
||||||
if (serial_write(serial, buf, strlen(buf)) == -1) {
|
if (serial_write_blocking(serial, buf, strlen(buf)) == -1) {
|
||||||
sr_err("Failed to send: %s.", strerror(errno));
|
sr_err("Failed to send: %s.", strerror(errno));
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue