summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-11-16 13:09:34 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-16 13:09:34 -0600
commit9cb535fe4ef08b01e583ec955767a0899ff79afe (patch)
treee14c9f1555ffef55c84bef3824c50ac3b72aba59 /backends
parent500054f161c29ff9db125c0b872809191ad6920b (diff)
rng-egd: don't use gslist_free_full
This function was only introduced in glib 2.28.0. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/rng-egd.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index ec5835839..ad8473777 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -110,6 +110,18 @@ static void rng_egd_chr_read(void *opaque, const uint8_t *buf, int size)
}
}
+static void rng_egd_free_requests(RngEgd *s)
+{
+ GSList *i;
+
+ for (i = s->requests; i; i = i->next) {
+ rng_egd_free_request(i->data);
+ }
+
+ g_slist_free(s->requests);
+ s->requests = NULL;
+}
+
static void rng_egd_cancel_requests(RngBackend *b)
{
RngEgd *s = RNG_EGD(b);
@@ -118,9 +130,7 @@ static void rng_egd_cancel_requests(RngBackend *b)
* queue waiting to be read, this is okay, because there will always be
* more data than we requested originally
*/
- g_slist_free_full(s->requests,
- (GDestroyNotify)rng_egd_free_request);
- s->requests = NULL;
+ rng_egd_free_requests(s);
}
static void rng_egd_opened(RngBackend *b, Error **errp)
@@ -185,8 +195,7 @@ static void rng_egd_finalize(Object *obj)
g_free(s->chr_name);
- g_slist_free_full(s->requests, (GDestroyNotify)rng_egd_free_request);
- s->requests = NULL;
+ rng_egd_free_requests(s);
}
static void rng_egd_class_init(ObjectClass *klass, void *data)