summaryrefslogtreecommitdiff
path: root/examples/dpfp_threaded.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dpfp_threaded.c')
-rw-r--r--examples/dpfp_threaded.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/examples/dpfp_threaded.c b/examples/dpfp_threaded.c
index 7c36ab9..54e5ae3 100644
--- a/examples/dpfp_threaded.c
+++ b/examples/dpfp_threaded.c
@@ -92,7 +92,6 @@ static void *poll_thread_main(void *arg)
printf("poll thread shutting down\n");
pthread_exit(NULL);
- return NULL;
}
static int find_dpfp_device(void)
@@ -199,7 +198,7 @@ static int set_mode_async(unsigned char data)
if (!buf)
return -ENOMEM;
-
+
transfer = libusb_alloc_transfer(0);
if (!transfer) {
free(buf);
@@ -238,7 +237,7 @@ static int do_sync_intr(unsigned char *data)
}
static int sync_intr(unsigned char type)
-{
+{
int r;
unsigned char data[INTR_LENGTH];
@@ -424,7 +423,7 @@ static int alloc_transfers(void)
img_transfer = libusb_alloc_transfer(0);
if (!img_transfer)
return -ENOMEM;
-
+
irq_transfer = libusb_alloc_transfer(0);
if (!irq_transfer)
return -ENOMEM;
@@ -444,9 +443,7 @@ static void sighandler(int signum)
int main(void)
{
-#ifndef __MINGW32__
struct sigaction sigact;
-#endif
int r = 1;
r = libusb_init(NULL);
@@ -477,17 +474,13 @@ int main(void)
goto out_deinit;
/* async from here onwards */
-#ifndef __MINGW32__
+
sigact.sa_handler = sighandler;
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
sigaction(SIGQUIT, &sigact, NULL);
-#else
- signal(SIGINT, sighandler);
- signal(SIGTERM, sighandler);
-#endif
r = pthread_create(&poll_thread, NULL, poll_thread_main, NULL);
if (r)