summaryrefslogtreecommitdiff
path: root/examples/dpfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dpfp.c')
-rw-r--r--examples/dpfp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/dpfp.c b/examples/dpfp.c
index bd9702a..e218246 100644
--- a/examples/dpfp.c
+++ b/examples/dpfp.c
@@ -416,7 +416,9 @@ static void sighandler(int signum)
int main(void)
{
+#ifndef __MINGW32__
struct sigaction sigact;
+#endif
int r = 1;
r = libusb_init(NULL);
@@ -456,12 +458,17 @@ int main(void)
if (r < 0)
goto out_deinit;
+#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
while (!do_exit) {
r = libusb_handle_events(NULL);