From f791cc4b4470c90ac8b4fd2205a840d0f222513e Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Sat, 10 Mar 2007 18:40:25 +0000 Subject: bail out at startup with an error message if LC_ALL is set --- lib/Smokeping.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 9f8c8a7..6721a1b 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -20,7 +20,10 @@ setlogsock('unix') # make sure we do not end up with , in odd places where one would expect a '.' # we set the environment variable so that our 'kids' get the benefit too $ENV{LC_NUMERIC}='C'; -POSIX::setlocale(&POSIX::LC_NUMERIC,""); +if (POSIX::setlocale(&POSIX::LC_NUMERIC,"") ne "C") { + die("Resetting LC_NUMERIC failed - try removing LC_ALL from the environment"); +} + use File::Basename; use Smokeping::Examples; -- cgit v1.2.3-24-g4f1b