* [PATCH 1/2] g_string_free shell be used in IRMC
@ 2010-11-11 20:46 Dmitriy Paliy
2010-11-11 20:46 ` [PATCH 2/2] string_free is specific to filesystem only Dmitriy Paliy
2010-11-11 21:23 ` [PATCH 1/2] g_string_free shell be used in IRMC Johan Hedberg
0 siblings, 2 replies; 4+ messages in thread
From: Dmitriy Paliy @ 2010-11-11 20:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Dmitriy Paliy
g_string_free instead of string_free shell be used in IRMC plugin.
string_free is a callback function specific to filesystem plugin
only and used by OBEX drivers to close an OBEX object.
---
plugins/irmc.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/plugins/irmc.c b/plugins/irmc.c
index 28c5e50..f7ad33b 100644
--- a/plugins/irmc.c
+++ b/plugins/irmc.c
@@ -254,10 +254,8 @@ static void irmc_disconnect(struct obex_session *os, void *user_data)
g_free(irmc->params);
}
- if (irmc->buffer) {
- string_free(irmc->buffer);
- irmc->buffer = NULL;
- }
+ if (irmc->buffer)
+ g_string_free(irmc->buffer, TRUE);
g_free(irmc);
}
@@ -355,7 +353,7 @@ static void *irmc_open_pb(const char *name, struct irmc_session *irmc,
irmc->buffer = mybuf;
else {
irmc->buffer = g_string_append(irmc->buffer, mybuf->str);
- string_free(mybuf);
+ g_string_free(mybuf, TRUE);
}
return irmc;
@@ -433,7 +431,7 @@ static int irmc_close(void *object)
DBG("");
if (irmc->buffer) {
- string_free(irmc->buffer);
+ g_string_free(irmc->buffer, TRUE);
irmc->buffer = NULL;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] string_free is specific to filesystem only
2010-11-11 20:46 [PATCH 1/2] g_string_free shell be used in IRMC Dmitriy Paliy
@ 2010-11-11 20:46 ` Dmitriy Paliy
2010-11-11 21:23 ` Johan Hedberg
2010-11-11 21:23 ` [PATCH 1/2] g_string_free shell be used in IRMC Johan Hedberg
1 sibling, 1 reply; 4+ messages in thread
From: Dmitriy Paliy @ 2010-11-11 20:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Dmitriy Paliy
string_free is a callback function specific to filesystem plugin only.
It is used by OBEX drivers when closing OBEX object and not API
exposed to other plugins. g_string_free can be used instead of it when
required.
---
plugins/filesystem.c | 2 +-
plugins/filesystem.h | 1 -
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/plugins/filesystem.c b/plugins/filesystem.c
index bf00ac2..bb758ab 100644
--- a/plugins/filesystem.c
+++ b/plugins/filesystem.c
@@ -474,7 +474,7 @@ static void *pcsuite_open(const char *name, int oflag, mode_t mode,
return append_listing(object, name, TRUE, size, err);
}
-int string_free(void *object)
+static int string_free(void *object)
{
GString *string = object;
diff --git a/plugins/filesystem.h b/plugins/filesystem.h
index 712653f..9c7ad9a 100644
--- a/plugins/filesystem.h
+++ b/plugins/filesystem.h
@@ -21,5 +21,4 @@
*
*/
-int string_free(void *object);
ssize_t string_read(void *object, void *buf, size_t count);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/2] g_string_free shell be used in IRMC
2010-11-11 20:46 [PATCH 1/2] g_string_free shell be used in IRMC Dmitriy Paliy
2010-11-11 20:46 ` [PATCH 2/2] string_free is specific to filesystem only Dmitriy Paliy
@ 2010-11-11 21:23 ` Johan Hedberg
1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2010-11-11 21:23 UTC (permalink / raw)
To: Dmitriy Paliy; +Cc: linux-bluetooth, Dmitriy Paliy
Hi Dmitriy,
On Thu, Nov 11, 2010, Dmitriy Paliy wrote:
> g_string_free instead of string_free shell be used in IRMC plugin.
> string_free is a callback function specific to filesystem plugin
> only and used by OBEX drivers to close an OBEX object.
> ---
> plugins/irmc.c | 10 ++++------
> 1 files changed, 4 insertions(+), 6 deletions(-)
Thanks, pushed upstream after I fixed your email address (should be
@nokia.com, check your gitconfig) and summary line (which should start
with Add/Fix/Make/Use etc to be consistent with the rest of the commit
history.
Johan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-11 21:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-11 20:46 [PATCH 1/2] g_string_free shell be used in IRMC Dmitriy Paliy
2010-11-11 20:46 ` [PATCH 2/2] string_free is specific to filesystem only Dmitriy Paliy
2010-11-11 21:23 ` Johan Hedberg
2010-11-11 21:23 ` [PATCH 1/2] g_string_free shell be used in IRMC Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox