Changeset 1171


Ignore:
Timestamp:
Feb 15, 2007, 10:51:21 AM (13 years ago)
Author:
bruno
Message:

asprintf => mr_asprintf + getline => mr_getline

Location:
branches/stable/mondo/src/common
Files:
2 edited

Legend:

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

    r1168 r1171  
    999999  row = 1;
    10001000  // skip first output row - contains registered RAID levels
    1001   res = getline(&string, &len, fin);
     1001  res = mr_getline(&string, &len, fin);
    10021002  // parse the rest
    10031003  while ( !feof_unlocked(fin) ) {
    1004     res = getline(&string, &len, fin);
     1004    res = mr_getline(&string, &len, fin);
    10051005    if (res <= 0) break;
    10061006    // trim leading spaces
    10071007    pos = string;
    10081008    while (*pos == ' ') pos += 1;
    1009     asprintf(&strtmp, pos);
     1009    mr_asprintf(&strtmp, pos);
    10101010    strcpy(string, strtmp);
    10111011    mr_free(strtmp);
     
    10281028    token = mr_strtok (string, delims, &lastpos);
    10291029    // get RAID device name
    1030     asprintf(&strtmp,"%s%s", device_prefix, token);
     1030    mr_asprintf(&strtmp,"%s%s", device_prefix, token);
    10311031    strcpy(raidlist->el[raidlist->entries].raid_device, strtmp);
    10321032    mr_free(strtmp);
     
    10871087      case ' ': // normal data disks
    10881088        raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].index = atoi(pos + 1);
    1089         asprintf(&strtmp,"%s%s", device_prefix, token);
     1089        mr_asprintf(&strtmp,"%s%s", device_prefix, token);
    10901090        strcpy(raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].device, strtmp);
    10911091        mr_free(strtmp);
     
    10941094      case 'S': // spare disks
    10951095        raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].index = atoi(pos + 1);
    1096         asprintf(&strtmp,"%s%s", device_prefix, token);
     1096        mr_asprintf(&strtmp,"%s%s", device_prefix, token);
    10971097        strcpy(raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].device, strtmp);
    10981098        mr_free(strtmp);
     
    11011101      case 'F': // failed disks
    11021102        raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].index = atoi(pos + 1);
    1103         asprintf(&strtmp,"%s%s", device_prefix, token);
     1103        mr_asprintf(&strtmp,"%s%s", device_prefix, token);
    11041104        strcpy(raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].device, strtmp);
    11051105        mr_free(strtmp);
  • branches/stable/mondo/src/common/newt-specific.c

    r1168 r1171  
    260260char *tmp = NULL;
    261261
    262 asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print %s;}' | grep -vx \"\\?\"`", ps_options, str , ps_proc_id);
     262mr_asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print %s;}' | grep -vx \"\\?\"`", ps_options, str , ps_proc_id);
    263263run_program_and_log_output(tmp, TRUE);
    264264mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.