[Gluster-devel] Locale problem in master

Anders Blomdell anders.blomdell at control.lth.se
Mon Jul 7 17:22:36 UTC 2014


On 2014-07-07 18:57, Pranith Kumar Karampuri wrote:
> Including Bala who is the author of the commit
> 
> Pranith
> On 07/07/2014 10:18 PM, Anders Blomdell wrote:
>> Due to the line (commit 040319d8bced2f25bf25d8f6b937901c3a40e34b):
>>
>>    ./libglusterfs/src/logging.c:503:        setlocale(LC_ALL, "");
>>
>> The command
>>
>>    env -i LC_NUMERIC=sv_SE.utf8 /usr/sbin/glusterfs ...
>>
>> will fail due to the fact that the swedish decimal separator is not '.', but ',',
>> i.e. _gf_string2double will fail due to strtod ('1.0', &tail) will give the tail
>> '.0'.
>>
>> /Anders
>>
> 
Simple fix:


--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -501,6 +501,7 @@ gf_openlog (const char *ident, int option, int facility)
 
         /* TODO: Should check for errors here and return appropriately */
         setlocale(LC_ALL, "");
+        setlocale(LC_NUMERIC, "C");
         /* close the previous syslog if open as we are changing settings */
         closelog ();
         openlog(ident, _option, _facility);


-- 
Anders Blomdell                  Email: anders.blomdell at control.lth.se
Department of Automatic Control
Lund University                  Phone:    +46 46 222 4625
P.O. Box 118                     Fax:      +46 46 138118
SE-221 00 Lund, Sweden



More information about the Gluster-devel mailing list