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