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:
Martin Ling 2014-09-16 02:14:23 +01:00 committed by Uwe Hermann
parent 485b9ae34d
commit a5053ddd21
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ static int agdmm_send(const struct sr_dev_inst *sdi, const char *cmd)
strncat(buf, "\r\n", 32);
else
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));
return SR_ERR;
}