Re: [PATCH] util: Extract locale-related fixes into separate functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 22, 2017 at 03:49:03PM +0200, Peter Krempa wrote:
On Thu, Jun 22, 2017 at 14:36:53 +0200, Martin Kletzander wrote:
Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/util/virstring.c | 96 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 60 insertions(+), 36 deletions(-)

diff --git a/src/util/virstring.c b/src/util/virstring.c
index feea5be05198..6125725364f3 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -522,6 +522,7 @@ virStrToLong_ullp(char const *s, char **end_ptr, int base,
 #if HAVE_NEWLOCALE

 static locale_t virLocale;
+static locale_t virLocaleOld;

This is not a thread local variable ...


Oh. shoot, you're right.  So we need to wrap it in our struct that will
be defined conditionally as well, or allocate it on the heap, copy it
there and set a pointer to it as one additional parameter or make thread
local variable, but that one will need to be a pointer to the locale, so
we'll need to allocate it on the heap as well.  I don't like the way
this is going.  Anyone else feel free to continue on this if you want to
clean this up, but I like the few small conditional blocks better,
especially since we have them in only two functions.

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux