]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/motech-lps-30x/protocol.c
usb: Skip add/remove of FD on destroyed source
[libsigrok.git] / src / hardware / motech-lps-30x / protocol.c
index 751d2d261a3df742033922916fbb68557571808b..81808faf23741977e3223caf15041f3b34bf97e5 100644 (file)
@@ -23,6 +23,7 @@
  *  @internal
  */
 
+#include <config.h>
 #include <errno.h>
 #include <string.h>
 #include "protocol.h"
@@ -193,9 +194,10 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
                return TRUE;
 
        if (devc->acq_req_pending) {
-               gint64 elapsed_us = g_get_monotonic_time() - devc->req_sent_at;
+               int64_t elapsed_us = g_get_monotonic_time() - devc->req_sent_at;
                if (elapsed_us > (REQ_TIMEOUT_MS * 1000)) {
-                       sr_spew("Request timeout: req=%d t=%lldus", (int)devc->acq_req, elapsed_us);
+                       sr_spew("Request timeout: req=%d t=%" PRIi64 "us",
+                               (int)devc->acq_req, elapsed_us);
                        devc->acq_req_pending = 0;
                }
        }