Ignore:
Timestamp:
Aug 18, 2009, 3:05:43 PM (11 years ago)
Author:
Bruno Cornec
Message:

r3334@localhost: bruno | 2009-08-08 12:17:37 +0200

  • Change mr_asprintf interface to pass only the char * (makes bkpinfo usage more easy)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-raid.c

    r2321 r2323  
    5050    int res;
    5151
    52     mr_asprintf(&command, "grep \"");
     52    mr_asprintf(command, "grep \"");
    5353    if (raidno == -1) {
    5454        mr_strcat(command, "linear");
     
    197197    assert(label != NULL);
    198198
    199     mr_asprintf(&sz_value, "%d", value);
     199    mr_asprintf(sz_value, "%d", value);
    200200    strcpy(raidrec->additional_vars.el[lino].label, label);
    201201    strcpy(raidrec->additional_vars.el[lino].value, sz_value);
     
    585585    fclose(fin);
    586586    log_it("Raidtab loaded successfully.");
    587     mr_asprintf(&tmp1, "%d RAID devices in raidtab", raidlist->entries);
     587    mr_asprintf(tmp1, "%d RAID devices in raidtab", raidlist->entries);
    588588    log_it(tmp1);
    589589    mr_free(tmp1);
     
    744744        }
    745745        if (!disklist) {
    746             mr_asprintf(&tmp, "Ignoring '%s %s' pair of disk %s", labelB, valueB, label);
     746            mr_asprintf(tmp, "Ignoring '%s %s' pair of disk %s", labelB, valueB, label);
    747747            log_it(tmp);
    748748            mr_free(tmp);
     
    10061006    pos = string;
    10071007    while (*pos == ' ') pos += 1;
    1008     mr_asprintf(&strtmp, "%s", pos);
     1008    mr_asprintf(strtmp, "%s", pos);
    10091009    strcpy(string, strtmp);
    10101010    paranoid_free(strtmp);
     
    10271027    token = mr_strtok(string, delims, &lastpos);
    10281028    // get RAID device name
    1029     mr_asprintf(&strtmp,"%s%s", device_prefix, token);
     1029    mr_asprintf(strtmp,"%s%s", device_prefix, token);
    10301030    strcpy(raidlist->el[raidlist->entries].raid_device, strtmp);
    10311031    paranoid_free(strtmp);
     
    10861086      case ' ': // normal data disks
    10871087        raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].index = atoi(pos + 1);
    1088         mr_asprintf(&strtmp,"%s%s", device_prefix, token);
     1088        mr_asprintf(strtmp,"%s%s", device_prefix, token);
    10891089        strcpy(raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].device, strtmp);
    10901090        paranoid_free(strtmp);
     
    10931093      case 'S': // spare disks
    10941094        raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].index = atoi(pos + 1);
    1095         mr_asprintf(&strtmp,"%s%s", device_prefix, token);
     1095        mr_asprintf(strtmp,"%s%s", device_prefix, token);
    10961096        strcpy(raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].device, strtmp);
    10971097        paranoid_free(strtmp);
     
    11001100      case 'F': // failed disks
    11011101        raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].index = atoi(pos + 1);
    1102         mr_asprintf(&strtmp,"%s%s", device_prefix, token);
     1102        mr_asprintf(strtmp,"%s%s", device_prefix, token);
    11031103        strcpy(raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].device, strtmp);
    11041104        paranoid_free(strtmp);
Note: See TracChangeset for help on using the changeset viewer.