Force the use of '.' as decimal separator.

This solves issues occurring with a different decimal operator and
keeps the command line interface consistent for all locales .
E.g. `zfs set quota=0.5T`

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Felix Neumärker <xdch47@posteo.de>
Closes #10878
This commit is contained in:
xdch47 2020-09-09 19:14:04 +02:00 committed by GitHub
parent a74259cea0
commit c2c7ca0d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View File

@ -182,6 +182,7 @@ main(int argc, char **argv)
int error, c; int error, c;
(void) setlocale(LC_ALL, ""); (void) setlocale(LC_ALL, "");
(void) setlocale(LC_NUMERIC, "C");
(void) textdomain(TEXT_DOMAIN); (void) textdomain(TEXT_DOMAIN);
opterr = 0; opterr = 0;

View File

@ -8468,6 +8468,7 @@ main(int argc, char **argv)
char **newargv; char **newargv;
(void) setlocale(LC_ALL, ""); (void) setlocale(LC_ALL, "");
(void) setlocale(LC_NUMERIC, "C");
(void) textdomain(TEXT_DOMAIN); (void) textdomain(TEXT_DOMAIN);
opterr = 0; opterr = 0;

View File

@ -10229,6 +10229,7 @@ main(int argc, char **argv)
char **newargv; char **newargv;
(void) setlocale(LC_ALL, ""); (void) setlocale(LC_ALL, "");
(void) setlocale(LC_NUMERIC, "C");
(void) textdomain(TEXT_DOMAIN); (void) textdomain(TEXT_DOMAIN);
srand(time(NULL)); srand(time(NULL));