[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/mfgtools][debian/master] 3 commits: New upstream version 1.4.193

Henry-Nicolas Tourneur (@hntourne) gitlab at salsa.debian.org
Tue Feb 22 16:31:39 GMT 2022



Henry-Nicolas Tourneur pushed to branch debian/master at Debian On Mobile / mfgtools


Commits:
dc3ec314 by Henry-Nicolas Tourneur at 2022-02-22T16:26:58+00:00
New upstream version 1.4.193
- - - - -
69e8cec1 by Henry-Nicolas Tourneur at 2022-02-22T16:27:05+00:00
Update upstream source from tag 'upstream/1.4.193'

Update to upstream version '1.4.193'
with Debian dir 5f087bae71799a30a8b03aba5f6a09132250acc5
- - - - -
ac969165 by Henry-Nicolas Tourneur at 2022-02-22T16:28:02+00:00
d/changelog: document changes and release

- - - - -


3 changed files:

- debian/changelog
- libuuu/error.cpp
- libuuu/usbhotplug.cpp


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+mfgtools (1.4.193-1) unstable; urgency=medium
+
+  * New upstream version 1.4.193
+
+ -- Henry-Nicolas Tourneur <debian at nilux.be>  Tue, 22 Feb 2022 16:27:47 +0000
+
 mfgtools (1.4.191-1) unstable; urgency=medium
 
   * New upstream version 1.4.191


=====================================
libuuu/error.cpp
=====================================
@@ -31,6 +31,7 @@
 
 #include "liberror.h"
 #include "libuuu.h"
+#include "libusb.h"
 
 using namespace std;
 
@@ -39,14 +40,20 @@ static int g_last_err_id;
 
 static uint32_t g_debug_level;
 
-void uuu_set_debug_level(uint32_t mask)
+int get_libusb_debug_level() noexcept
 {
-	g_debug_level = mask;
+	return g_debug_level & 0xFFFF;
 }
 
-int get_libusb_debug_level() noexcept
+void uuu_set_debug_level(uint32_t mask)
 {
-	return g_debug_level & 0xFFFF;
+	g_debug_level = mask;
+
+#if LIBUSB_API_VERSION > 0x01000106
+		libusb_set_option(nullptr, LIBUSB_OPTION_LOG_LEVEL, get_libusb_debug_level());
+#else
+		libusb_set_debug(nullptr, get_libusb_debug_level());
+#endif
 }
 
 const char * uuu_get_last_err_string()


=====================================
libuuu/usbhotplug.cpp
=====================================
@@ -69,6 +69,11 @@ static atomic<KnownDeviceState> g_known_device_state{NoKnownDevice};
 class CAutoDeInit
 {
 public:
+	CAutoDeInit()
+	{
+		if (libusb_init(nullptr) < 0)
+				throw runtime_error{ "Call libusb_init failure" };
+	}
 	~CAutoDeInit()
 	{
 		libusb_exit(nullptr);
@@ -399,31 +404,8 @@ static int check_usb_timeout(Timer& usb_timer)
 	return 0;
 }
 
-static int ensure_libusb_initialized()
-{
-	static once_flag is_libusb_init;
-	try {
-		call_once(is_libusb_init, []{
-			if (libusb_init(nullptr) < 0)
-				throw runtime_error{"Call libusb_init failure"};
-#if LIBUSB_API_VERSION > 0x01000106
-			libusb_set_option(nullptr, LIBUSB_OPTION_LOG_LEVEL, get_libusb_debug_level());
-#else
-			libusb_set_debug(nullptr, get_libusb_debug_level());
-#endif
-		});
-	} catch(const exception& ex) {
-		set_last_err_string(ex.what());
-		return -1;
-	}
-	return 0;
-}
-
 int polling_usb(std::atomic<int>& bexit)
 {
-	if (ensure_libusb_initialized())
-		return -1;
-
 	if (run_cmds("CFG:", nullptr))
 		return -1;
 
@@ -463,9 +445,6 @@ CmdUsbCtx::~CmdUsbCtx()
 
 int CmdUsbCtx::look_for_match_device(const char *pro)
 {
-	if (ensure_libusb_initialized())
-		return -1;
-
 	if (run_cmds("CFG:", nullptr))
 		return -1;
 
@@ -535,9 +514,6 @@ int uuu_add_usbpath_filter(const char *path)
 
 int uuu_for_each_devices(uuu_ls_usb_devices fn, void *p)
 {
-	if (ensure_libusb_initialized())
-		return -1;
-
 	CAutoList l;
 	size_t i = 0;
 	libusb_device *dev;



View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/mfgtools/-/compare/c6c6e82aae6e825383898d43d03855964b19aec0...ac969165a09c662152d89aa41207cbc3854ec521

-- 
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/mfgtools/-/compare/c6c6e82aae6e825383898d43d03855964b19aec0...ac969165a09c662152d89aa41207cbc3854ec521
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20220222/d3b5e033/attachment-0001.htm>


More information about the Debian-on-mobile-maintainers mailing list