]> sourceware.org Git - lvm2.git/commitdiff
Don't use index and rindex functions marked by SUSv3 as legacy - Jakub Bogusz <qboosh...
authorDave Wysochanski <dwysocha@redhat.com>
Mon, 2 Jul 2007 11:17:21 +0000 (11:17 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Mon, 2 Jul 2007 11:17:21 +0000 (11:17 +0000)
WHATS_NEW
lib/activate/activate.c
lib/activate/dev_manager.c
lib/format_text/archive.c
lib/format_text/format-text.c
lib/snapshot/snapshot.c

index e66f7b125841967d72fba974d2c85f026904b5af..1f020cf1f405f90086f5b19fe3111465614abb3d 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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)
index aba7f91c702f6bc6d4f20e752e8cecf7abc8a55b..980351606a86136be552ff2f15db1f166a9beb27 100644 (file)
@@ -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;
index d452150bf56710e8dbe24a5ba5dfec9ff2755181..3282f9728f0fa2db441231ab1500540ebeee12ed 100644 (file)
@@ -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);
index ca94c7424890d5a3631e3e517ac410c4b468eb99..c6af857b1226421d725dfc6558e3c7d5f5fc34d7 100644 (file)
@@ -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)
index b43d0c83f2766454e6025b4458503a3eba094565..e8bf6f6fefae716ad0996f3b8458eb29c8805779 100644 (file)
@@ -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;
index 2dad6dc7ea7ebd4c358cc1032b64b4015741f523..34417cb0aeddb03a3691420e1f49ef4f61ec4ed7 100644 (file)
@@ -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;
This page took 0.045607 seconds and 5 git commands to generate.