diff --git a/src/exec.c b/src/exec.c index 61ec4fb8b..76875e44b 100644 --- a/src/exec.c +++ b/src/exec.c @@ -47,6 +47,9 @@ #if TIME_WITH_SYS_TIME # include #endif +#ifdef HAVE_SETLOCALE +# include +#endif #include #include #include @@ -198,6 +201,14 @@ sudo_execve(struct command_details *details, char *argv[], char *envp[], if (ISSET(details->flags, CD_SET_TIMEOUT)) alarm(details->timeout); +#ifdef HAVE_SETLOCALE + /* + * I/O logging must be in the C locale for floating point numbers + * to be logged consistently. + */ + setlocale(LC_ALL, "C"); +#endif + /* * In the event loop we pass input from user tty to master * and pass output from master to stdout and IO plugin.