fix: set the process locale through Locale::setProcessLocale

main
reionwong 6 days ago
parent a5393be41e
commit 73ed274f3e

@ -1,4 +1,3 @@
#include <clocale>
#include <csignal>
#include <sys/epoll.h>
#include <sys/signalfd.h>
@ -7,6 +6,7 @@
#include "base/command_line.h"
#include "base/event_loop.h"
#include "base/i18n.h"
#include "base/locale.h"
#include "base/logging.h"
#include "config.h"
@ -16,7 +16,7 @@ using namespace cutefish;
int main(int argc, char *argv[])
{
std::setlocale(LC_ALL, "");
base::Locale::setProcessLocale();
i18n::setDomain("cutefish-dm");
// Through signalfd, so SIGTERM runs the daemon's teardown.

@ -4,7 +4,6 @@
#include <security/pam_appl.h>
#include <cerrno>
#include <clocale>
#include <csignal>
#include <cstdio>
#include <cstdlib>
@ -21,6 +20,7 @@
#include <vector>
#include "base/i18n.h"
#include "base/locale.h"
#include "base/strings.h"
#include "../common/wire.h"
@ -280,7 +280,7 @@ static std::vector<std::string> strings(const Json &array)
int main()
{
std::setlocale(LC_ALL, "");
cutefish::base::Locale::setProcessLocale();
cutefish::i18n::setDomain("cutefish-dm");
// The daemon's signalfd mask is inherited; without this SIGTERM never lands.

Loading…
Cancel
Save