From patchwork Wed Dec 23 15:34:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 7913071 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6C1FE9F349 for ; Wed, 23 Dec 2015 15:34:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC531203EC for ; Wed, 23 Dec 2015 15:34:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E228D2038A for ; Wed, 23 Dec 2015 15:34:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BA886E311; Wed, 23 Dec 2015 07:34:54 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 678036E311 for ; Wed, 23 Dec 2015 07:34:52 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 23 Dec 2015 07:34:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,469,1444719600"; d="scan'208";a="877513742" Received: from djmorton-linux2.isw.intel.com ([10.102.226.90]) by orsmga002.jf.intel.com with ESMTP; 23 Dec 2015 07:34:51 -0800 From: Derek Morton To: intel-gfx@lists.freedesktop.org Date: Wed, 23 Dec 2015 15:34:48 +0000 Message-Id: <1450884888-18931-1-git-send-email-derek.j.morton@intel.com> X-Mailer: git-send-email 1.9.1 Cc: thomas.wood@intel.com Subject: [Intel-gfx] [PATCH i-g-t] igt_core: Fix logging to display extended line 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=-4.2 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 line[strlen(line)] will always evaluate to NULL so line_continuation was always true. That prevented the program name, pid and log level ever being printed. Changed to [strlen(line) - 1] so the last character before the null terminator is compared with '\n' to determine line_continuation. Signed-off-by: Derek Morton --- lib/igt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 84cf8d2..221ed7e 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1748,7 +1748,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, goto out; } - line_continuation = line[strlen(line)] != '\n'; + line_continuation = line[strlen(line) - 1] != '\n'; /* append log buffer */ _igt_log_buffer_append(formatted_line);