Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool
@ 2011-03-02 22:36 Sheldon Demario
  2011-03-02 22:36 ` [PATCH 2/3] Add missing const to interactive() parameter " Sheldon Demario
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sheldon Demario @ 2011-03-02 22:36 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sheldon Demario

---
 attrib/gatttool.c    |    2 +-
 attrib/interactive.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index e51db7b..975fb47 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -538,7 +538,7 @@ int main(int argc, char *argv[])
 	GIOChannel *chan;
 	GSourceFunc callback;
 
-	opt_sec_level = strdup("low");
+	opt_sec_level = g_strdup("low");
 
 	context = g_option_context_new(NULL);
 	g_option_context_add_main_entries(context, options, NULL);
diff --git a/attrib/interactive.c b/attrib/interactive.c
index 52edeac..8429a47 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -303,7 +303,7 @@ static void cmd_connect(int argcp, char **argvp)
 
 	if (argcp > 1) {
 		g_free(opt_dst);
-		opt_dst = strdup(argvp[1]);
+		opt_dst = g_strdup(argvp[1]);
 	}
 
 	if (opt_dst == NULL) {
@@ -585,7 +585,7 @@ static void cmd_sec_level(int argcp, char **argvp)
 	}
 
 	g_free(opt_sec_level);
-	opt_sec_level = strdup(argvp[1]);
+	opt_sec_level = g_strdup(argvp[1]);
 
 	if (conn_state != STATE_CONNECTED)
 		return;
@@ -696,9 +696,9 @@ int interactive(gchar *dst, int psm)
 	GIOChannel *pchan;
 	gint events;
 
-	opt_sec_level = strdup("low");
+	opt_sec_level = g_strdup("low");
 
-	opt_dst = strdup(dst);
+	opt_dst = g_strdup(dst);
 	opt_psm = psm;
 
 	prompt = g_string_new(NULL);
-- 
1.7.1


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

* [PATCH 2/3] Add missing const to interactive() parameter in gatttool
  2011-03-02 22:36 [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool Sheldon Demario
@ 2011-03-02 22:36 ` Sheldon Demario
  2011-03-02 22:36 ` [PATCH 3/3] Add option to pass adapter to interactive gatttool Sheldon Demario
  2011-03-04 18:51 ` [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Sheldon Demario @ 2011-03-02 22:36 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sheldon Demario

---
 attrib/gatttool.h    |    2 +-
 attrib/interactive.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/attrib/gatttool.h b/attrib/gatttool.h
index 2fd4a46..e652a81 100644
--- a/attrib/gatttool.h
+++ b/attrib/gatttool.h
@@ -21,7 +21,7 @@
  *
  */
 
-int interactive(gchar *dst, gboolean le);
+int interactive(const gchar *dst, gboolean le);
 GIOChannel *gatt_connect(const gchar *src, const gchar *dst,
 			const gchar *sec_level, int psm, int mtu,
 			BtIOConnect connect_cb);
diff --git a/attrib/interactive.c b/attrib/interactive.c
index 8429a47..e39b43c 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -691,7 +691,7 @@ static gboolean prompt_read(GIOChannel *chan, GIOCondition cond,
 	return TRUE;
 }
 
-int interactive(gchar *dst, int psm)
+int interactive(const gchar *dst, int psm)
 {
 	GIOChannel *pchan;
 	gint events;
-- 
1.7.1


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

* [PATCH 3/3] Add option to pass adapter to interactive gatttool
  2011-03-02 22:36 [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool Sheldon Demario
  2011-03-02 22:36 ` [PATCH 2/3] Add missing const to interactive() parameter " Sheldon Demario
@ 2011-03-02 22:36 ` Sheldon Demario
  2011-03-04 18:51 ` [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Sheldon Demario @ 2011-03-02 22:36 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sheldon Demario

---
 attrib/gatttool.c    |    2 +-
 attrib/gatttool.h    |    2 +-
 attrib/interactive.c |    4 +++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 975fb47..4e344ba 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -572,7 +572,7 @@ int main(int argc, char *argv[])
 	}
 
 	if (opt_interactive) {
-		interactive(opt_dst, opt_psm);
+		interactive(opt_src, opt_dst, opt_psm);
 		goto done;
 	}
 
diff --git a/attrib/gatttool.h b/attrib/gatttool.h
index e652a81..89ac282 100644
--- a/attrib/gatttool.h
+++ b/attrib/gatttool.h
@@ -21,7 +21,7 @@
  *
  */
 
-int interactive(const gchar *dst, gboolean le);
+int interactive(const gchar *src, const gchar *dst, gboolean le);
 GIOChannel *gatt_connect(const gchar *src, const gchar *dst,
 			const gchar *sec_level, int psm, int mtu,
 			BtIOConnect connect_cb);
diff --git a/attrib/interactive.c b/attrib/interactive.c
index e39b43c..5fc0af5 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -691,13 +691,14 @@ static gboolean prompt_read(GIOChannel *chan, GIOCondition cond,
 	return TRUE;
 }
 
-int interactive(const gchar *dst, int psm)
+int interactive(const gchar *src, const gchar *dst, int psm)
 {
 	GIOChannel *pchan;
 	gint events;
 
 	opt_sec_level = g_strdup("low");
 
+	opt_src = g_strdup(src);
 	opt_dst = g_strdup(dst);
 	opt_psm = psm;
 
@@ -720,6 +721,7 @@ int interactive(const gchar *dst, int psm)
 	g_main_loop_unref(event_loop);
 	g_string_free(prompt, TRUE);
 
+	g_free(opt_src);
 	g_free(opt_dst);
 	g_free(opt_sec_level);
 
-- 
1.7.1


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

* Re: [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool
  2011-03-02 22:36 [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool Sheldon Demario
  2011-03-02 22:36 ` [PATCH 2/3] Add missing const to interactive() parameter " Sheldon Demario
  2011-03-02 22:36 ` [PATCH 3/3] Add option to pass adapter to interactive gatttool Sheldon Demario
@ 2011-03-04 18:51 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-03-04 18:51 UTC (permalink / raw)
  To: Sheldon Demario; +Cc: linux-bluetooth

Hi Sheldon,

On Wed, Mar 02, 2011, Sheldon Demario wrote:
> ---
>  attrib/gatttool.c    |    2 +-
>  attrib/interactive.c |    8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)

All three patches are now upstream. Thanks.

Johan

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

end of thread, other threads:[~2011-03-04 18:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02 22:36 [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool Sheldon Demario
2011-03-02 22:36 ` [PATCH 2/3] Add missing const to interactive() parameter " Sheldon Demario
2011-03-02 22:36 ` [PATCH 3/3] Add option to pass adapter to interactive gatttool Sheldon Demario
2011-03-04 18:51 ` [PATCH 1/3] Replace all strdup() with g_strdup() in gatttool Johan Hedberg

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