[PATCH BlueZ 6/6] shared/uhid: Make use of io_send

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

---
 src/shared/uhid.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/shared/uhid.c b/src/shared/uhid.c
index 28c1792..f7ad0cb 100644
--- a/src/shared/uhid.c
+++ b/src/shared/uhid.c
@@ -228,15 +228,16 @@ bool bt_uhid_unregister(struct bt_uhid *uhid, unsigned int id)
 
 int bt_uhid_send(struct bt_uhid *uhid, const struct uhid_event *ev)
 {
-	int fd;
 	ssize_t len;
+	struct iovec iov;
 
 	if (!uhid->io)
 		return -ENOTCONN;
 
-	fd = io_get_fd(uhid->io);
+	iov.iov_base = (void *) ev;
+	iov.iov_len = sizeof(*ev);
 
-	len = write(fd, ev, sizeof(*ev));
+	len = io_send(uhid->io, &iov, 1);
 	if (len < 0)
 		return -errno;
 
-- 
1.9.3

--
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