From: Martin Ling Date: Sun, 21 Sep 2014 17:54:00 +0000 (+0100) Subject: mic-985xx: Make serial write call block. X-Git-Tag: libsigrok-0.4.0~953 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=3e2373247cf0b3c8557fb718d988b21a0299770c;p=libsigrok.git mic-985xx: 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. --- diff --git a/src/hardware/mic-985xx/protocol.c b/src/hardware/mic-985xx/protocol.c index 3a133ca7..9d0e603b 100644 --- a/src/hardware/mic-985xx/protocol.c +++ b/src/hardware/mic-985xx/protocol.c @@ -24,7 +24,7 @@ static int mic_send(struct sr_serial_dev_inst *serial, const char *cmd) { int ret; - if ((ret = serial_write(serial, cmd, strlen(cmd))) < 0) { + if ((ret = serial_write_blocking(serial, cmd, strlen(cmd))) < 0) { sr_err("Error sending '%s' command: %d.", cmd, ret); return SR_ERR; }