From patchwork Wed Apr 4 16:16:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 10322831 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 06F9B60390 for ; Wed, 4 Apr 2018 16:18:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB5EE28448 for ; Wed, 4 Apr 2018 16:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E020528F0F; Wed, 4 Apr 2018 16:17:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BEC6F28F0D for ; Wed, 4 Apr 2018 16:17:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0117733BDD; Wed, 4 Apr 2018 16:17:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C081765B4C; Wed, 4 Apr 2018 16:17:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 880131800CA2; Wed, 4 Apr 2018 16:17:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w34GHtbn012126 for ; Wed, 4 Apr 2018 12:17:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 956076920B; Wed, 4 Apr 2018 16:17:55 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFA176920C; Wed, 4 Apr 2018 16:17:52 +0000 (UTC) Received: from prv3-mh.provo.novell.com (victor.provo.novell.com [137.65.250.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9475D7FDD3; Wed, 4 Apr 2018 16:17:50 +0000 (UTC) Received: from apollon.suse.de.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Wed, 04 Apr 2018 10:17:38 -0600 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Date: Wed, 4 Apr 2018 18:16:15 +0200 Message-Id: <20180404161627.6244-9-mwilck@suse.com> In-Reply-To: <20180404161627.6244-1-mwilck@suse.com> References: <20180404161627.6244-1-mwilck@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 04 Apr 2018 16:17:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 04 Apr 2018 16:17:50 +0000 (UTC) for IP:'137.65.250.26' DOMAIN:'victor.provo.novell.com' HELO:'prv3-mh.provo.novell.com' FROM:'mwilck@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.26 victor.provo.novell.com 137.65.250.26 victor.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: dm-devel@redhat.com Cc: Julian Andres Klode , dm-devel@redhat.com, Martin Wilck Subject: [dm-devel] [PATCH v4 08/20] libmultipath: use const char* in open_file() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 04 Apr 2018 16:17:58 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- libmultipath/file.c | 6 +++--- libmultipath/file.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/file.c b/libmultipath/file.c index e4951c9..d5165ec 100644 --- a/libmultipath/file.c +++ b/libmultipath/file.c @@ -37,7 +37,7 @@ */ static int -ensure_directories_exist(char *str, mode_t dir_mode) +ensure_directories_exist(const char *str, mode_t dir_mode) { char *pathname; char *end; @@ -80,7 +80,7 @@ sigalrm(int sig) } static int -lock_file(int fd, char *file_name) +lock_file(int fd, const char *file_name) { struct sigaction act, oldact; sigset_t set, oldset; @@ -118,7 +118,7 @@ lock_file(int fd, char *file_name) } int -open_file(char *file, int *can_write, char *header) +open_file(const char *file, int *can_write, const char *header) { int fd; struct stat s; diff --git a/libmultipath/file.h b/libmultipath/file.h index 4f96dbf..70bffa5 100644 --- a/libmultipath/file.h +++ b/libmultipath/file.h @@ -6,6 +6,6 @@ #define _FILE_H #define FILE_TIMEOUT 30 -int open_file(char *file, int *can_write, char *header); +int open_file(const char *file, int *can_write, const char *header); #endif /* _FILE_H */