]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/atten-pps3xxx/api.c
Fix similar broken error handling on several serial calls.
[libsigrok.git] / src / hardware / atten-pps3xxx / api.c
index 75a1fbbd3e3355ce75096fed5b93fc303995c934..a0f84152405f6725c2af1dc2a7ed48fc818c9e61 100644 (file)
@@ -130,9 +130,8 @@ static GSList *scan(GSList *options, int modelid)
        memset(packet, 0, PACKET_SIZE);
        packet[0] = 0xaa;
        packet[1] = 0xaa;
-       if (serial_write_blocking(serial, packet, PACKET_SIZE) == -1) {
-               sr_err("Unable to write while probing for hardware: %s",
-                               strerror(errno));
+       if (serial_write_blocking(serial, packet, PACKET_SIZE) < PACKET_SIZE) {
+               sr_err("Unable to write while probing for hardware.");
                return NULL;
        }
        /* The device responds with a 24-byte packet when it receives a packet.