Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...

PATCH [email protected] 1 participant 1 message Jul 2, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2007-07-02 11:17:21

Modified files:
. : WHATS_NEW
lib/activate : activate.c dev_manager.c
lib/format_text: archive.c format-text.c
lib/snapshot : snapshot.c

Log message:
Don't use index and rindex functions marked by SUSv3 as legacy - Jakub Bogusz <[email protected]>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.643&r2=1.644
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.124&r2=1.125
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.27 - 
 ================================
+  Don't use index and rindex functions marked by SUSv3 as legacy.
   Fix vgsplit if splitting all PVs from VG.
   Fix lvmdiskscan volume reporting when run in the lvm shell
   Fix missing lvm_shell symbol in lvm2cmd library. (2.02.23)
lib/activate/activate.c +1 -1
@@ -313,7 +313,7 @@
 			else
 				continue;
 		}
-		if (!index(str, '/')) {
+		if (!strchr(str, '/')) {
 			/* vgname supplied */
 			if (!strcmp(str, lv->vg->name))
 				return 1;
lib/activate/dev_manager.c +1 -1
@@ -561,7 +561,7 @@
 	log_debug("Getting device info for %s", dl->name);
 
 	/* Rename? */
-		if ((suffix = rindex(dl->dlid + sizeof(UUID_PREFIX) - 1, '-')))
+		if ((suffix = strrchr(dl->dlid + sizeof(UUID_PREFIX) - 1, '-')))
 			suffix++;
 		newname = build_dm_name(dm->mem, dm->vg_name, dl->lv->name,
 					suffix);
lib/format_text/archive.c +1 -1
@@ -71,7 +71,7 @@
 	if (strcmp(".vg", dot))
 		return 0;
 
-	if (!(underscore = rindex(filename, '_')))
+	if (!(underscore = strrchr(filename, '_')))
 		return 0;
 
 	if (sscanf(underscore + 1, "%u", ix) != 1)
lib/format_text/format-text.c +2 -2
@@ -850,7 +850,7 @@
 	char *slash;
 	char temp_file[PATH_MAX], temp_dir[PATH_MAX];
 
-	slash = rindex(tc->path_edit, '/');
+	slash = strrchr(tc->path_edit, '/');
 
 	if (slash == 0)
 		strcpy(temp_dir, ".");
@@ -948,7 +948,7 @@
 		return 0;
 
 	/* vgrename? */
-	if ((slash = rindex(tc->path_live, '/')))
+	if ((slash = strrchr(tc->path_live, '/')))
 		slash = slash + 1;
 	else
 		slash = tc->path_live;
lib/snapshot/snapshot.c +1 -1
@@ -98,7 +98,7 @@
 	float percent2;
 	uint64_t numerator, denominator;
 
-	if (index(params, '/')) {
+	if (strchr(params, '/')) {
 		if (sscanf(params, "%" PRIu64 "/%" PRIu64,
 			   &numerator, &denominator) == 2) {
 			*total_numerator += numerator;