Blame SOURCES/0002-Revert-use-atexit-to-call-libusb_exit.patch

efe87b
From eb590b4dac00a5188b93e1d6ebdd60b06f9ab3d7 Mon Sep 17 00:00:00 2001
efe87b
From: Hans de Goede <hdegoede@redhat.com>
efe87b
Date: Thu, 13 Feb 2014 17:25:27 +0100
efe87b
Subject: [libusb-compat PATCH 2/2] Revert "use atexit() to call libusb_exit()"
efe87b
efe87b
The use of atexit() breaks various users of libusb-compat,
efe87b
see ie: https://bugzilla.redhat.com/show_bug.cgi?id=1003193
efe87b
efe87b
This reverts commit 0be16b8dd25733d242ae32b57823a9513ec21353.
efe87b
efe87b
Closes libusbx/libusb-compat-0.1#2
efe87b
efe87b
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
efe87b
---
efe87b
 libusb/core.c | 10 ----------
efe87b
 1 file changed, 10 deletions(-)
efe87b
efe87b
diff --git a/libusb/core.c b/libusb/core.c
efe87b
index c0ccb1f..2dd1b5f 100644
efe87b
--- a/libusb/core.c
efe87b
+++ b/libusb/core.c
efe87b
@@ -21,7 +21,6 @@
efe87b
 #include <config.h>
efe87b
 #include <errno.h>
efe87b
 #include <stdarg.h>
efe87b
-#include <stdlib.h>
efe87b
 #include <stdio.h>
efe87b
 #include <string.h>
efe87b
 
efe87b
@@ -137,13 +136,6 @@ static void usbi_log(enum usbi_log_level level, const char *function,
efe87b
 	fprintf(stream, "\n");
efe87b
 }
efe87b
 
efe87b
-static void _usb_finalize(void) {
efe87b
-       if (ctx) {
efe87b
-          libusb_exit(ctx);
efe87b
-               ctx = NULL;
efe87b
-               }
efe87b
-}
efe87b
-
efe87b
 API_EXPORTED void usb_init(void)
efe87b
 {
efe87b
 	int r;
efe87b
@@ -159,8 +151,6 @@ API_EXPORTED void usb_init(void)
efe87b
 		/* usb_set_debug can be called before usb_init */
efe87b
 		if (usb_debug)
efe87b
 			libusb_set_debug(ctx, 3);
efe87b
-
efe87b
-               atexit(_usb_finalize);
efe87b
 	}
efe87b
 }
efe87b
 
efe87b
-- 
efe87b
1.8.5.3
efe87b