b7d4d7
From e43af5b15d14e43c3201fd0fb7bf02663e3e0127 Mon Sep 17 00:00:00 2001
b7d4d7
From: Rinku Kothiya <rkothiya@redhat.com>
b7d4d7
Date: Sat, 7 Nov 2020 12:09:36 +0530
b7d4d7
Subject: [PATCH 482/511] logger: Always print errors in english
b7d4d7
b7d4d7
Upstream:
b7d4d7
> Reviewed-on: https://github.com/gluster/glusterfs/pull/1657
b7d4d7
> fixes: #1302
b7d4d7
> Change-Id: If0e21f016155276a953c64a8dd13ff3eb281d09d
b7d4d7
> Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
b7d4d7
b7d4d7
BUG: 1896425
b7d4d7
b7d4d7
Change-Id: If0e21f016155276a953c64a8dd13ff3eb281d09d
b7d4d7
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
b7d4d7
Reviewed-on: https://code.engineering.redhat.com/gerrit/219999
b7d4d7
Tested-by: RHGS Build Bot <nigelb@redhat.com>
b7d4d7
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
b7d4d7
---
b7d4d7
 libglusterfs/src/logging.c | 6 +++++-
b7d4d7
 1 file changed, 5 insertions(+), 1 deletion(-)
b7d4d7
b7d4d7
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
b7d4d7
index 7f0eff6..5874c34 100644
b7d4d7
--- a/libglusterfs/src/logging.c
b7d4d7
+++ b/libglusterfs/src/logging.c
b7d4d7
@@ -513,6 +513,7 @@ gf_openlog(const char *ident, int option, int facility)
b7d4d7
 {
b7d4d7
     int _option = option;
b7d4d7
     int _facility = facility;
b7d4d7
+    char *language = NULL;
b7d4d7
 
b7d4d7
     if (-1 == _option) {
b7d4d7
         _option = LOG_PID | LOG_NDELAY;
b7d4d7
@@ -522,7 +523,10 @@ gf_openlog(const char *ident, int option, int facility)
b7d4d7
     }
b7d4d7
 
b7d4d7
     /* TODO: Should check for errors here and return appropriately */
b7d4d7
-    setlocale(LC_ALL, "");
b7d4d7
+    language = setlocale(LC_ALL, "en_US.UTF-8");
b7d4d7
+    if (!language)
b7d4d7
+        setlocale(LC_ALL, "");
b7d4d7
+
b7d4d7
     setlocale(LC_NUMERIC, "C"); /* C-locale for strtod, ... */
b7d4d7
     /* close the previous syslog if open as we are changing settings */
b7d4d7
     closelog();
b7d4d7
-- 
b7d4d7
1.8.3.1
b7d4d7