Ignore:
Timestamp:
Jul 22, 2009, 2:03:44 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Fix a printing error in mindi for the tar command
  • Fix all mr_asprintf which had no second param as a string
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-cli.c

    r2241 r2290  
    362362
    363363    log_msg(5, "dsf: %s", dsf);
    364    
     364
    365365    /********
    366366    * See if a device special file was passed in (i.e. it must start with /dev/
     
    386386    }
    387387    log_msg(5, "  %s device special file exists", dsf);
    388    
     388
    389389    /* Get a list of the mounted file systems */
    390390    if (create_list_of_non_NFS_mounted_file_systems()) {
     
    398398    * Either way, it's an error.
    399399    ********/
    400     mr_asprintf(&command,
    401       "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf);
     400    mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf);
    402401    log_msg(4, "Executing: %s", command);
    403402    mr_asprintf(&partition_list, "%s", call_program_and_get_last_line_of_output(command));
     
    452451        log_msg(4, "Processing partition: %s", partitions[i]);
    453452        /* See if it's swap. If it is, ignore it. */
    454         mr_asprintf(&command,
    455           "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'",
     453        mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'",
    456454          dsf, partitions[i]);
    457455        log_msg(4, "  Running: %s", command);
     
    490488        if (strlen(tmp)) {
    491489            log_msg(4, "  Partition ID: %s", tmp);
    492             if (!strcasecmp(tmp, "8e")) { 
     490            if (!strcasecmp(tmp, "8e")) {
    493491                /* It's LVM: Find the VG it's in */
    494492                log_msg(4, "  It's LVM: Find the VG it's in...");
     
    501499                    /* Found the Volume Group. Now find all of the VG's mount points */
    502500                    log_msg(4, "  Found the Volume Group. Now find all of the VG's mount points");
    503                     mr_asprintf(&command,
    504                       "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'",
    505                       VG, VG);
     501                    mr_asprintf(&command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG);
    506502                    log_msg(4, "  Running: %s", command);
    507503                    mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command));
     
    525521                     *******/
    526522                    paranoid_free(mount_list);
    527                     mr_asprintf(&command, "%s",
    528                         "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
     523                    mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    529524                    log_msg (5, "Running: %s", command);
    530525                    mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command));
    531526                    paranoid_free(command);
    532                     log_msg(4, "  Software raid device list: %s", mount_list);   
     527                    log_msg(4, "  Software raid device list: %s", mount_list);
    533528                    lastpos = 0;
    534529                    while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) {
    535                         mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG); 
     530                        mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG);
    536531                        log_msg (5, "Running: %s", command);
    537532                        paranoid_free(tmp);
     
    579574        log_msg (5, "  UUID: %s", tmp);
    580575        /* Get the Software raid device list */
    581         mr_asprintf(&command, "%s",
    582          "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
     576        mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    583577        log_msg (5, "  Running: %s", command);
    584578        mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command));
    585579        paranoid_free(command);
    586         log_msg(4, "  Software raid device list: %s", mount_list);   
     580        log_msg(4, "  Software raid device list: %s", mount_list);
    587581        /* Loop through the software raid device list to see if we can find the partition */
    588582        lastpos = 0;
     
    767761            strcat(bkpinfo->include_paths, " ");
    768762        }
    769        
     763
    770764        mr_asprintf(&tmp1, "%s", flag_val['I']);
    771765        p = tmp1;
     
    15141508            if (flag_set[opt]) {
    15151509                bad_switches = TRUE;
    1516                 mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt,
    1517                         flag_val[opt]);
     1510                mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt, flag_val[opt]);
    15181511                log_to_screen(tmp);
    15191512                paranoid_free(tmp);
     
    15311524                        if (strchr(flag_val[opt], '/')
    15321525                            && flag_val[opt][0] != '/') {
    1533                             mr_asprintf(&tmp,
    1534                                     "-%c flag --- must be absolute path --- '%s' isn't absolute",
    1535                                     opt, flag_val[opt]);
     1526                            mr_asprintf(&tmp, "-%c flag --- must be absolute path --- '%s' isn't absolute", opt, flag_val[opt]);
    15361527                            log_to_screen(tmp);
    15371528                            paranoid_free(tmp);
     
    16041595    case SIGABRT:
    16051596        mr_asprintf(&tmp, "SIGABRT");
    1606         mr_asprintf(&tmp2,
    1607                 "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.");
     1597        mr_asprintf(&tmp2, "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.");
    16081598        break;
    16091599    default:
Note: See TracChangeset for help on using the changeset viewer.