From patchwork Fri Dec 14 08:59:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 48 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 17E2660B10 for ; Fri, 14 Dec 2018 09:59:12 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 97F6E549; Fri, 14 Dec 2018 09:59:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1544777951; bh=v9Lu/OC6meoWttFh86Q/ubU83ez1BcUQakRMRJHhCZw=; h=From:To:Cc:Subject:Date:From; b=QfugnJSw6dbArawj0ZyT6D6VBRjjTanObmhH+9Czl0dClvu7l2yXOrP6xppkoT9LR XvQ4PSbrIgu2mjINJo3oJyBns4fstlaYUEgInz6NIIPuDTjTvUrNmHXCpkAynIBTqq K3HeoBPze2s2P6ymbD1bNlKwWTR98uq2VuhgwaB0= From: Kieran Bingham To: LibCamera Devel Date: Fri, 14 Dec 2018 08:59:09 +0000 Message-Id: <20181214085909.32325-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH] log: Use libgen implementation of basename X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2018 08:59:12 -0000 Pull in the libgen header to define basename. Unfortuantely this requires casting away the const flag on the filename. Signed-off-by: Kieran Bingham --- src/libcamera/log.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp index 3715e69d810e..7096071e53f6 100644 --- a/src/libcamera/log.cpp +++ b/src/libcamera/log.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "log.h" #include "utils.h" @@ -80,7 +81,7 @@ LogMessage::LogMessage(const char *fileName, unsigned int line, << std::setw(9) << timestamp.tv_nsec << "]"; msgStream << " " << log_severity_name(severity); - msgStream << " " << basename(fileName) << ":" << line << " "; + msgStream << " " << basename((char *)fileName) << ":" << line << " "; } LogMessage::~LogMessage()