mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-23 21:35:29 +03:00
Don't use index and rindex functions marked by SUSv3 as legacy - Jakub Bogusz <qboosh@pld-linux.org>
This commit is contained in:
parent
b228dfaf2c
commit
5f951faf32
@ -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)
|
||||
|
@ -313,7 +313,7 @@ static int _passes_activation_filter(struct cmd_context *cmd,
|
||||
else
|
||||
continue;
|
||||
}
|
||||
if (!index(str, '/')) {
|
||||
if (!strchr(str, '/')) {
|
||||
/* vgname supplied */
|
||||
if (!strcmp(str, lv->vg->name))
|
||||
return 1;
|
||||
|
@ -561,7 +561,7 @@ int dev_manager_mirror_percent(struct dev_manager *dm,
|
||||
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);
|
||||
|
@ -71,7 +71,7 @@ static int _split_vg(const char *filename, char *vgname, size_t vg_size,
|
||||
if (strcmp(".vg", dot))
|
||||
return 0;
|
||||
|
||||
if (!(underscore = rindex(filename, '_')))
|
||||
if (!(underscore = strrchr(filename, '_')))
|
||||
return 0;
|
||||
|
||||
if (sscanf(underscore + 1, "%u", ix) != 1)
|
||||
|
@ -850,7 +850,7 @@ static int _vg_write_file(struct format_instance *fid, struct volume_group *vg,
|
||||
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 @@ static int _vg_commit_file(struct format_instance *fid, struct volume_group *vg,
|
||||
return 0;
|
||||
|
||||
/* vgrename? */
|
||||
if ((slash = rindex(tc->path_live, '/')))
|
||||
if ((slash = strrchr(tc->path_live, '/')))
|
||||
slash = slash + 1;
|
||||
else
|
||||
slash = tc->path_live;
|
||||
|
@ -98,7 +98,7 @@ static int _snap_target_percent(void **target_state __attribute((unused)),
|
||||
float percent2;
|
||||
uint64_t numerator, denominator;
|
||||
|
||||
if (index(params, '/')) {
|
||||
if (strchr(params, '/')) {
|
||||
if (sscanf(params, "%" PRIu64 "/%" PRIu64,
|
||||
&numerator, &denominator) == 2) {
|
||||
*total_numerator += numerator;
|
||||
|
Loading…
Reference in New Issue
Block a user