All of lore.kernel.org
 help / color / mirror / Atom feed
From: bmarzins@sourceware.org
To: dm-cvs@sourceware.org, dm-devel@redhat.com
Subject: multipath-tools/libmultipath callout.c
Date: 24 Oct 2011 13:39:56 -0000	[thread overview]
Message-ID: <20111024133956.31687.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2011-10-24 13:39:56

Modified files:
	libmultipath   : callout.c 

Log message:
	Fix for bz #729478. Add a new callout format parameter %c, that converts the "!"
	in cciss device names to "/".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/callout.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3

--- multipath-tools/libmultipath/callout.c	2009/05/15 21:01:26	1.5.2.2
+++ multipath-tools/libmultipath/callout.c	2011/10/24 13:39:56	1.5.2.3
@@ -133,6 +133,19 @@
 	return retval;
 }
 
+void
+convert_cciss(char *dest, char *src)
+{
+	char *ptr;
+
+	strcpy(dest, src);
+	if (strncmp(src, "cciss", 5))
+		return;
+	ptr = strrchr(dest, '!');
+	if (ptr)
+		*ptr = '/';
+}
+
 extern int
 apply_format (char * string, char * cmd, struct path * pp)
 {
@@ -141,6 +154,7 @@
 	char * p;
 	int len;
 	int myfree;
+	char converted_dev[FILE_NAME_SIZE];
 
 	if (!string)
 		return 1;
@@ -179,6 +193,17 @@
 		snprintf(p, len, "%s", pp->dev);
 		p += len - 1;
 		break;
+	case 'c':
+		convert_cciss(converted_dev, pp->dev);
+		len = strlen(converted_dev) + 1;
+		myfree -= len;
+
+		if (myfree < 2)
+			return 1;
+
+		snprintf(p, len, "%s", converted_dev);
+		p += len - 1;
+		break;
 	case 'd':
 		len = strlen(pp->dev_t) + 1;
 		myfree -= len;

                 reply	other threads:[~2011-10-24 13:39 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=20111024133956.31687.qmail@sourceware.org \
    --to=bmarzins@sourceware.org \
    --cc=dm-cvs@sourceware.org \
    --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.