Skip to contentSkip to conversation

Fix using wrong argument in test-serial

PATCH In review Luiz Augusto von Dentz 2 participants 4 messages Aug 16, 2010 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 Fix using wrong argument in test-serial

From: Luiz Augusto von Dentz <[email protected]>

---
 test/test-serial |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
test/test-serial +1 -1
index ed151dc..cc496df 100755
@@ -29,7 +29,7 @@ if (len(args) < 1):
 	print "Usage: %s <address> [service]" % (sys.argv[0])
 	sys.exit(1)
 
-address = sys.argv[0]
+address = args[0]
 
 if (len(args) < 2):
 	service = "spp"
Signature · 1 line
1.7.0.4
author maintainer
#1 lore raw

PATCH 2/2 Fix not storing tty id on pnatd plugin

From: Luiz Augusto von Dentz <[email protected]>

The code used to create the port stored the id in a local variable instead of storing it in the client data which is used to release the port once disconnected.

---
 plugins/pnat.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
plugins/pnat.c +5 -4
index f9136a4..3f5222f 100644
@@ -238,7 +238,7 @@ static gboolean create_tty(struct dun_server *server)
 {
 	struct dun_client *client = &server->client;
 	struct rfcomm_dev_req req;
-	int dev, sk = g_io_channel_unix_get_fd(client->io);
+	int sk = g_io_channel_unix_get_fd(client->io);
 
 	memset(&req, 0, sizeof(req));
 	req.dev_id = -1;
@@ -251,13 +251,14 @@ static gboolean create_tty(struct dun_server *server)
 			BT_IO_OPT_DEST_CHANNEL, &req.channel,
 			BT_IO_OPT_INVALID);
 
-	dev = ioctl(sk, RFCOMMCREATEDEV, &req);
-	if (dev < 0) {
+	client->tty_id = ioctl(sk, RFCOMMCREATEDEV, &req);
+	if (client->tty_id < 0) {
 		error("Can't create RFCOMM TTY: %s", strerror(errno));
 		return FALSE;
 	}
 
-	snprintf(client->tty_name, PATH_MAX - 1, "/dev/rfcomm%d", dev);
+	snprintf(client->tty_name, PATH_MAX - 1, "/dev/rfcomm%d",
+							client->tty_id);
 
 	client->tty_tries = TTY_TRIES;
 
Signature · 1 line
1.7.0.4
#2 lore raw

Re: [PATCH 2/2] Fix not storing tty id on pnatd plugin

Hi Luiz,

Quoted 5 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

The code used to create the port stored the id in a local variable instead of storing it in the client data which is used to release the port once disconnected.

Nice catch. The patch is now upstream.

Johan

#3 lore raw
In reply to Luiz Augusto von Dentz

Hi Luiz,

Quoted 11 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 test/test-serial |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
test/test-serial +0 -0
index ed151dc..cc496df 100755

test/test-serial if (len(args) < 1): · line 35

Quoted 8 lines
test/test-serial +1 -1
@@ -29,7 +29,7 @@ if (len(args) < 1):
 	print "Usage: %s <address> [service]" % (sys.argv[0])
 	sys.exit(1)
 
-address = sys.argv[0]
+address = args[0]
 
 if (len(args) < 2):
 	service = "spp"

The patch is now upstream. Thanks.

Johan