summaryrefslogtreecommitdiff
path: root/usb_source.c
diff options
context:
space:
mode:
Diffstat (limited to 'usb_source.c')
-rw-r--r--usb_source.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usb_source.c b/usb_source.c
index 1a8174d..761d103 100644
--- a/usb_source.c
+++ b/usb_source.c
@@ -20,11 +20,9 @@
* Web: http://ni.fr.eu.org/
* Email: <nico at ni.fr.eu.org>
*/
-#include <assert.h>
#include <stdbool.h>
#include "usb_source.h"
-#include "utils.h"
struct fd_tag {
int fd;
@@ -102,7 +100,7 @@ usb_source_pollfd_removed(int fd, void *user_data)
found = true;
}
}
- assert(found);
+ g_assert(found);
}
}
@@ -112,7 +110,7 @@ usb_source_new(libusb_context *usb)
/* Get file descriptors. */
const struct libusb_pollfd **pollfds = libusb_get_pollfds(usb);
if (!pollfds)
- utils_fatal("unable to get libusb file descriptors");
+ g_error("unable to get libusb file descriptors");
/* Create source. */
static GSourceFuncs funcs = {
.prepare = usb_source_prepare,
@@ -125,7 +123,7 @@ usb_source_new(libusb_context *usb)
g_source_set_name(source, "usb");
usb_source->usb = usb;
usb_source->fd_tag = g_array_new(FALSE, FALSE, sizeof(struct fd_tag));
- assert(libusb_pollfds_handle_timeouts(usb));
+ g_assert(libusb_pollfds_handle_timeouts(usb));
/* Add existing file descriptors. */
for (const struct libusb_pollfd **pollfd = pollfds; *pollfd; pollfd++)
usb_source_pollfd_added((*pollfd)->fd, (*pollfd)->events, usb_source);