From patchwork Wed Jun 24 10:29:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 6666751 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8DF13C05AC for ; Wed, 24 Jun 2015 10:29:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C60AB206A7 for ; Wed, 24 Jun 2015 10:29:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BBEE22060A for ; Wed, 24 Jun 2015 10:29:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51FE16E037; Wed, 24 Jun 2015 03:29:51 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id B79F66E037 for ; Wed, 24 Jun 2015 03:29:49 -0700 (PDT) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 41446946-1500048 for multiple; Wed, 24 Jun 2015 11:30:15 +0100 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Wed, 24 Jun 2015 11:29:33 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 24 Jun 2015 11:29:28 +0100 Message-Id: <1435141768-23816-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.1.4 X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [igt] Enable locale dependent output to a terminal X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we are in an interactive session, enable the locale. This allows for features like setting thousand separators for printing large values. By only enabling it for interactive terminals, we avoid changing outputs for the test scripts (leaving them as the "C" locale). Signed-off-by: Chris Wilson Reviewed-by: Michel Thierry --- lib/igt_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/igt_core.c b/lib/igt_core.c index 1367863..8ac1f33 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -55,6 +55,7 @@ #include #include #include +#include #include "drmtest.h" #include "intel_chipset.h" @@ -523,6 +524,9 @@ static int common_init(int *argc, char **argv, int ret = 0; char *env = getenv("IGT_LOG_LEVEL"); + if (isatty(STDOUT_FILENO)) + setlocale(LC_ALL, ""); + if (env) { if (strcmp(env, "debug") == 0) igt_log_level = IGT_LOG_DEBUG;