Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] input: Fix signedness issue on POSIX error code usage
@ 2012-08-24 21:03 Anderson Lizardo
  2012-08-26  7:29 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Anderson Lizardo @ 2012-08-24 21:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo

By convention, error variables containing POSIX error code (usually
called "err") are negative. This commit fixes a couple of places where
positive values are expected.
---
 profiles/input/hog_device.c |    2 +-
 profiles/input/server.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index 10c5a45..f0caac8 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/input/hog_device.c
@@ -570,7 +570,7 @@ static gboolean uhid_event_cb(GIOChannel *io, GIOCondition cond,
 	bread = read(fd, &ev, sizeof(ev));
 	if (bread < 0) {
 		int err = -errno;
-		DBG("uhid-dev read: %s(%d)", strerror(err), err);
+		DBG("uhid-dev read: %s(%d)", strerror(-err), -err);
 		goto failed;
 	}
 
diff --git a/profiles/input/server.c b/profiles/input/server.c
index 86e2ac8..8965c4e 100644
--- a/profiles/input/server.c
+++ b/profiles/input/server.c
@@ -180,7 +180,7 @@ static void confirm_event_cb(GIOChannel *chan, gpointer user_data)
 
 	ba2str(&src, addr);
 	error("input: authorization for %s failed: %s (%d)",
-						addr, strerror(-ret), ret);
+						addr, strerror(-ret), -ret);
 
 	g_io_channel_unref(server->confirm);
 	server->confirm = NULL;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-26  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 21:03 [PATCH BlueZ] input: Fix signedness issue on POSIX error code usage Anderson Lizardo
2012-08-26  7:29 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox