]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/atten-pps3xxx/protocol.c
Fix similar broken error handling on several serial calls.
[libsigrok.git] / src / hardware / atten-pps3xxx / protocol.c
index 66ecb7a28ff2cde835de7db59c122e3685283963..95137d2e9a8164e86041d5184129ab749173c75f 100644 (file)
@@ -86,8 +86,8 @@ SR_PRIV void send_packet(const struct sr_dev_inst *sdi, uint8_t *packet)
        struct sr_serial_dev_inst *serial;
 
        serial = sdi->conn;
-       if (serial_write_blocking(serial, packet, PACKET_SIZE) == -1)
-               sr_dbg("Failed to send packet: %s", strerror(errno));
+       if (serial_write_blocking(serial, packet, PACKET_SIZE) < PACKET_SIZE)
+               sr_dbg("Failed to send packet.");
        dump_packet("sent", packet);
 }