]> sigrok.org Git - libsigrok.git/commitdiff
agilent-dmm: Make serial write call block in send.
authorMartin Ling <redacted>
Tue, 16 Sep 2014 01:14:23 +0000 (02:14 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:18:21 +0000 (23:18 +0200)
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.

src/hardware/agilent-dmm/sched.c

index 2329c076cb176b6c4fb02640d96ad1aff5336d94..66cb60a2b5eaa59efb9239b0d83209cd5458ceca 100644 (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;
        }