From 17e2fd3bfdacaad771463bc0d6189e624bca2912 Mon Sep 17 00:00:00 2001 From: xdch47 <34678034+xdch47@users.noreply.github.com> Date: Wed, 9 Sep 2020 19:14:04 +0200 Subject: [PATCH] Force the use of '.' as decimal separator. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Felix Neumärker Closes #10878 --- cmd/mount_zfs/mount_zfs.c | 1 + cmd/zfs/zfs_main.c | 1 + cmd/zpool/zpool_main.c | 1 + 3 files changed, 3 insertions(+) diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index 87d2ccadcd..ed9f167cca 100644 --- a/cmd/mount_zfs/mount_zfs.c +++ b/cmd/mount_zfs/mount_zfs.c @@ -182,6 +182,7 @@ main(int argc, char **argv) int error, c; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 1a113c5c03..20579157d7 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -8468,6 +8468,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index adbb78a8ef..cd1c66323a 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -10229,6 +10229,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); srand(time(NULL));