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