[PATCH] android: Fix error handling in adapter_ready

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On error negative value is passed to adapter_ready callback. This fix
passing negative error code to strerror.
---
 android/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/main.c b/android/main.c
index 93870d0..36cc8aa 100644
--- a/android/main.c
+++ b/android/main.c
@@ -465,8 +465,8 @@ static GOptionEntry options[] = {
 
 static void adapter_ready(int err)
 {
-	if (err) {
-		error("Adapter initialization failed: %s", strerror(err));
+	if (err < 0) {
+		error("Adapter initialization failed: %s", strerror(-err));
 		exit(EXIT_FAILURE);
 	}
 
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux