All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: christophe varoqui <christophe.varoqui@free.fr>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH] multipath compilation fixes
Date: Fri, 09 Dec 2005 13:06:01 +0100	[thread overview]
Message-ID: <43997329.7080803@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

Hi Christophe,

dm_mapname returns a strdup()ed string, which does not really
qualify as const. This patchs corrects it.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: multipath-tools-compile-fix.patch --]
[-- Type: text/x-patch, Size: 1312 bytes --]

[devmapper] Compilation fixes

As we're returning a strdup()ed string from dm_mapname() it hardly
qualifies as 'const'.

Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
--- a/kpartx/devmapper.c
+++ b/kpartx/devmapper.c
@@ -119,11 +119,12 @@ out:
 }
 
 
-const char *
+char *
 dm_mapname(int major, int minor)
 {
 	struct dm_task *dmt;
-	const char *mapname = NULL, *map;
+	char *mapname = NULL;
+	const char *map;
 
 	if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
 		return NULL;
diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h
--- a/kpartx/devmapper.h
+++ b/kpartx/devmapper.h
@@ -2,5 +2,5 @@ int dm_prereq (char *, int, int, int);
 int dm_simplecmd (int, const char *);
 int dm_addmap (int, const char *, const char *, const char *, unsigned long);
 int dm_map_present (char *);
-const char * dm_mapname(int major, int minor);
+char * dm_mapname(int major, int minor);
 dev_t dm_get_first_dep(char *devname);
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -675,7 +675,8 @@ out:
 char *
 dm_mapname(int major, int minor)
 {
-	char * response = NULL, *map;
+	char * response = NULL;
+	const char *map;
 	struct dm_task *dmt;
 	int r;
 	int loop = MAX_WAIT * LOOPS_PER_SEC;

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



                 reply	other threads:[~2005-12-09 12:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43997329.7080803@suse.de \
    --to=hare@suse.de \
    --cc=christophe.varoqui@free.fr \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.