Diff between d8f8bdc0a185adfd0b88dece2da83bc22cf189aa and 65610e08abe70e456f9a9e72154607b757db04e8

Changed Files

File Additions Deletions Status
profiles/input/device.c +7 -7 modified

Full Patch

diff --git a/profiles/input/device.c b/profiles/input/device.c
index bded1ea..f1fa716 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
@@ -333,7 +333,7 @@ static int ioctl_connadd(struct hidp_connadd_req *req)
 	return err;
 }
 
-static int ioctl_is_connected(struct input_device *idev)
+static bool ioctl_is_connected(struct input_device *idev)
 {
 	struct hidp_conninfo ci;
 	int ctl;
@@ -342,7 +342,7 @@ static int ioctl_is_connected(struct input_device *idev)
 	ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HIDP);
 	if (ctl < 0) {
 		error("Can't open HIDP control socket");
-		return 0;
+		return false;
 	}
 
 	memset(&ci, 0, sizeof(ci));
@@ -350,15 +350,15 @@ static int ioctl_is_connected(struct input_device *idev)
 	if (ioctl(ctl, HIDPGETCONNINFO, &ci) < 0) {
 		error("Can't get HIDP connection info");
 		close(ctl);
-		return 0;
+		return false;
 	}
 
 	close(ctl);
 
 	if (ci.state != BT_CONNECTED)
-		return 0;
-	else
-		return 1;
+		return false;
+
+	return true;
 }
 
 static int ioctl_disconnect(struct input_device *idev, uint32_t flags)
@@ -510,7 +510,7 @@ cleanup:
 	return err;
 }
 
-static int is_connected(struct input_device *idev)
+static bool is_connected(struct input_device *idev)
 {
 	return ioctl_is_connected(idev);
 }