Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:GA
systemd-mini
0005-sd-resolve-fix-allocation-if-query-ids-nev...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0005-sd-resolve-fix-allocation-if-query-ids-never-reuse-t.patch of Package systemd-mini
Based on 85529c815b47c22839e0f148af67fd37e977cbfa Mon Sep 17 00:00:00 2001 From: Lennart Poettering <lennart@poettering.net> Date: Tue, 12 Aug 2014 19:29:27 +0200 Subject: [PATCH] sd-resolve: fix allocation if query ids, never reuse them --- src/libsystemd/sd-resolve/sd-resolve.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) --- src/libsystemd/sd-resolve/sd-resolve.c +++ src/libsystemd/sd-resolve/sd-resolve.c 2014-08-22 14:18:24.838235343 +0000 @@ -81,7 +81,7 @@ struct sd_resolve { pthread_t workers[WORKERS_MAX]; unsigned n_valid_workers; - unsigned current_id, current_index; + unsigned current_id; sd_resolve_query* queries[QUERIES_MAX]; unsigned n_queries; @@ -892,21 +892,17 @@ static int alloc_query(sd_resolve *resol if (r < 0) return r; - while (resolve->queries[resolve->current_index]) { - resolve->current_index++; + while (resolve->queries[resolve->current_id % QUERIES_MAX]) resolve->current_id++; - resolve->current_index %= QUERIES_MAX; - } - - q = resolve->queries[resolve->current_index] = new0(sd_resolve_query, 1); + q = resolve->queries[resolve->current_id % QUERIES_MAX] = new0(sd_resolve_query, 1); if (!q) return -ENOMEM; resolve->n_queries++; q->resolve = resolve; - q->id = resolve->current_id; + q->id = resolve->current_id++; *_q = q; return 0;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor