Changeset 2324 in MondoRescue for branches/2.2.10/mondo/src/mondorestore


Ignore:
Timestamp:
Aug 18, 2009, 3:13:54 PM (16 years ago)
Author:
Bruno Cornec
Message:

r3335@localhost: bruno | 2009-08-08 23:04:12 +0200

  • Change mr_asprintf to avoid the need of pointer and be consistent with the other mr_mem functions
Location:
branches/2.2.10/mondo/src/mondorestore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-prep.c

    r2323 r2324  
    484484                 fgets(incoming, MAX_STR_LEN - 1, fin));
    485485            if (!feof(fin)) {
    486                 mr_asprintf(tmp, "Investigating %s", old_mountlist->el[lino].device);
    487                 log_it(tmp);
    488                 mr_free(tmp);
     486                log_it("Investigating %s", old_mountlist->el[lino].device);
    489487
    490488                for (fgets(incoming, MAX_STR_LEN - 1, fin); !feof(fin)
     
    497495                        *p = '\0';
    498496                        for (p--; p > incoming && *(p - 1) > 32; p--);
    499                         mr_asprintf(tmp, "Extrapolating %s", p);
    500                         log_it(tmp);
    501                         mr_free(tmp);
     497                        log_it("Extrapolating %s", p);
    502498
    503499                        for (j = 0;
     
    518514                            new_mountlist->entries++;
    519515                        } else {
    520                             mr_asprintf(tmp, "Not adding %s to mountlist: it's already there", p);
    521                             log_it(tmp);
    522                             mr_free(tmp);
     516                            log_it("Not adding %s to mountlist: it's already there", p);
    523517                        }
    524518                    }
     
    585579  for (j = 1; j < raidlist->el[i].data_disks.entries; j++) {
    586580    mr_asprintf(strtmp, "%s", devices);
    587     paranoid_free(devices);
    588     mr_asprintf(devices, "%s %s", strtmp,
    589          raidlist->el[i].data_disks.el[j].device);
    590     paranoid_free(strtmp);
     581    mr_free(devices);
     582    mr_asprintf(devices, "%s %s", strtmp, raidlist->el[i].data_disks.el[j].device);
     583    mr_free(strtmp);
    591584  }
    592585  for (j = 0; j < raidlist->el[i].spare_disks.entries; j++) {
    593586    mr_asprintf(strtmp, "%s", devices);
    594     paranoid_free(devices);
    595     mr_asprintf(devices, "%s %s", strtmp,
    596          raidlist->el[i].spare_disks.el[j].device);
    597     paranoid_free(strtmp);
     587    mr_free(devices);
     588    mr_asprintf(devices, "%s %s", strtmp, raidlist->el[i].spare_disks.el[j].device);
     589    mr_free(strtmp);
    598590  }
    599591  // translate RAID level
     
    613605  if (raidlist->el[i].parity != -1) {
    614606    mr_asprintf(strtmp, "%s", program);
    615     paranoid_free(program);
     607    mr_free(program);
    616608    switch(raidlist->el[i].parity) {
    617609    case 0:
     
    635627  if (raidlist->el[i].chunk_size != -1) {
    636628    mr_asprintf(strtmp, "%s", program);
    637     paranoid_free(program);
     629    mr_free(program);
    638630    mr_asprintf(program, "%s --chunk=%d", strtmp, raidlist->el[i].chunk_size);
    639     paranoid_free(strtmp);
     631    mr_free(strtmp);
    640632  }
    641633  if (raidlist->el[i].spare_disks.entries > 0) {
    642634    mr_asprintf(strtmp, "%s", program);
    643     paranoid_free(program);
     635    mr_free(program);
    644636    mr_asprintf(program, "%s --spare-devices=%d", strtmp, raidlist->el[i].spare_disks.entries);
    645     paranoid_free(strtmp);
     637    mr_free(strtmp);
    646638  }
    647639  mr_asprintf(strtmp, "%s", program);
    648   paranoid_free(program);
     640  mr_free(program);
    649641  mr_asprintf(program, "%s %s", strtmp, devices);
    650   paranoid_free(strtmp);
     642  mr_free(strtmp);
    651643  res = run_program_and_log_output(program, 1);
    652   // free memory
    653   paranoid_free(devices);
    654   paranoid_free(level);
    655   paranoid_free(program);
    656   // return to calling instance
     644  mr_free(devices);
     645  mr_free(level);
     646  mr_free(program);
    657647  return res;
    658648}
     
    688678
    689679    if (strstr(format, "raid")) {   // do not form RAID disks; do it to /dev/md* instead
    690         mr_asprintf(tmp, "Not formatting %s (it is a RAID disk)", device);
    691         log_it(tmp);
    692         mr_free(tmp);
     680        log_it("Not formatting %s (it is a RAID disk)", device);
    693681        return (0);
    694682    }
     
    700688#endif
    701689    if (strlen(format) <= 2) {
    702         mr_asprintf(tmp, "%s has a really small format type ('%s') - this is probably a hexadecimal string, which would suggest the partition is an image --- I shouldn't format it", device, format);
    703         log_it(tmp);
    704         mr_free(tmp);
     690        log_it("%s has a really small format type ('%s') - this is probably a hexadecimal string, which would suggest the partition is an image --- I shouldn't format it", device, format);
    705691        return (0);
    706692    }
    707693    if (is_this_device_mounted(device)) {
    708         mr_asprintf(tmp, "%s is mounted - cannot format it       ", device);
    709         log_to_screen(tmp);
    710         mr_free(tmp);
     694        log_to_screen("%s is mounted - cannot format it       ", device);
    711695        return (1);
    712696    }
     
    736720            char line[MAX_STR_LEN];
    737721
    738             mr_asprintf(tmp, "Initializing Vinum device %s (this may take a *long* time)", device);
    739             log_to_screen(tmp);
    740             mr_free(tmp);
     722            log_to_screen("Initializing Vinum device %s (this may take a *long* time)", device);
    741723
    742724            /* format raid partition */
     
    782764        }
    783765#else
    784         mr_asprintf(tmp, "Initializing RAID device %s", device);
     766        log_to_screen(tmp, "Initializing RAID device %s", device);
    785767        log_to_screen(tmp);
    786768        mr_free(tmp);
     
    989971        me = &mountlist->el[lino];  // the current mountlist entry
    990972        if (!strcmp(me->mountpoint, "image")) {
    991             mr_asprintf(tmp, "Not formatting %s - it's an image", me->device);
    992             log_it(tmp);
    993             mr_free(tmp);
     973            log_it("Not formatting %s - it's an image", me->device);
    994974        } else if (!strcmp(me->format, "raid")) {
    995             mr_asprintf(tmp, "Not formatting %s - it's a raid-let", me->device);
    996             log_it(tmp);
    997             mr_free(tmp);
     975            log_it("Not formatting %s - it's a raid-let", me->device);
    998976            continue;
    999977        } else if (!strcmp(me->format, "lvm")) {
    1000             mr_asprintf(tmp, "Not formatting %s - it's an LVM", me->device);
    1001             log_it(tmp);
    1002             mr_free(tmp);
     978            log_it("Not formatting %s - it's an LVM", me->device);
    1003979            continue;
    1004980        } else if (!strncmp(me->device, "/dev/md", 7)) {
    1005             mr_asprintf(tmp, "Already formatted %s - it's a soft-RAID dev", me->device);
    1006             log_it(tmp);
    1007             mr_free(tmp);
     981            log_it("Already formatted %s - it's a soft-RAID dev", me->device);
    1008982            continue;
    1009983        } else if (!does_file_exist(me->device)
    1010984                   && strncmp(me->device, "/dev/hd", 7)
    1011985                   && strncmp(me->device, "/dev/sd", 7)) {
    1012             mr_asprintf(tmp, "Not formatting %s yet - doesn't exist - probably an LVM", me->device);
    1013             log_it(tmp);
    1014             mr_free(tmp);
     986            log_it("Not formatting %s yet - doesn't exist - probably an LVM", me->device);
    1015987            continue;
    1016988        } else {
     
    10481020    }
    10491021
    1050     mr_asprintf(tmp, "format_everything () - %s", (retval) ? "failed!" : "finished successfully");
    1051     log_it(tmp);
    1052     mr_free(tmp);
     1022    log_it("format_everything () - %s", (retval) ? "failed!" : "finished successfully");
    10531023
    10541024    if (g_partition_table_locked_up > 0) {
     
    11031073    int res;
    11041074
    1105     /** buffers **********************************************************/
    1106     char *tmp = NULL;
    1107 
    11081075    /** end **************************************************************/
    11091076
     
    11111078
    11121079    if (devno_we_must_allow_for >= 5) {
    1113         mr_asprintf(tmp, "Making dummy primary 1 on %s", drivename);
    1114         log_it(tmp);
    1115         mr_free(tmp);
     1080        log_it("Making dummy primary 1 on %s", drivename);
    11161081
    11171082        g_maximum_progress++;
     
    11271092    }
    11281093    for (; current_devno < devno_we_must_allow_for; current_devno++) {
    1129         mr_asprintf(tmp, "Creating dummy partition %d on %s", current_devno, drivename);
    1130         log_it(tmp);
    1131         mr_free(tmp);
     1094        log_it("Creating dummy partition %d on %s", current_devno, drivename);
    11321095        g_maximum_progress++;
    11331096        res =
     
    14681431    malloc_string(format);
    14691432
    1470     mr_asprintf(tmp, "Partitioning drive %s", drivename);
    1471     log_it(tmp);
    1472     mr_free(tmp);
     1433    log_it("Partitioning drive %s", drivename);
    14731434
    14741435#if __FreeBSD__
     
    15651526            file = open(drivename, O_WRONLY);
    15661527            if (file != -1) {
    1567                 mr_asprintf(tmp, "Warning - unable to open %s for wiping it's partition table", drivename);
    1568                 log_to_screen(tmp);
    1569                 mr_free(tmp);
     1528                log_to_screen("Warning - unable to open %s for wiping it's partition table", drivename);
    15701529            }
    15711530
    15721531            for (i = 0; i < 512; i++) {
    15731532                if (!write(file, "\0", 1)) {
    1574                     mr_asprintf(tmp, "Warning - unable to write to %s", drivename);
    1575                     log_to_screen(tmp);
    1576                     mr_free(tmp);
     1533                    log_to_screen("Warning - unable to write to %s", drivename);
    15771534                }
    15781535            }
     
    16331590
    16341591    if (pout_to_fdisk) {
    1635 // mark relevant partition as bootable
     1592        // mark relevant partition as bootable
    16361593        mr_asprintf(tmp, "a\n%s\n", call_program_and_get_last_line_of_output ("make-me-bootable /tmp/mountlist.txt dummy"));
    16371594        fput_string_one_char_at_a_time(pout_to_fdisk, tmp);
    16381595        mr_free(tmp);
    16391596
    1640 // close fdisk
     1597        // close fdisk
    16411598        fput_string_one_char_at_a_time(pout_to_fdisk, "w\n");
    16421599        system("sync");
     
    17081665
    17091666    if (!strncmp(drive, RAID_DEVICE_STUB, strlen(RAID_DEVICE_STUB))) {
    1710         mr_asprintf(tmp, "Not partitioning %s - it is a virtual drive", drive);
    1711         log_it(tmp);
    1712         mr_free(tmp);
    1713 
     1667        log_it("Not partitioning %s - it is a virtual drive", drive);
    17141668        return (0);
    17151669    }
     
    17251679
    17261680    if (is_this_device_mounted(partition_name)) {
    1727         mr_asprintf(tmp, "%s is mounted, and should not be partitioned", partition_name);
    1728         log_to_screen(tmp);
    1729         mr_free(tmp);
     1681        log_to_screen("%s is mounted, and should not be partitioned", partition_name);
    17301682        mr_free(partition_name);
    17311683        return (1);
     
    17691721    }
    17701722    mr_strcat(output, "\n");
    1771     mr_asprintf(tmp,"PARTSIZE = +%ld",(long)partsize);
    1772     log_it(tmp);
    1773     mr_free(tmp);
     1723    log_it("PARTSIZE = +%ld",(long)partsize);
    17741724
    17751725    log_it("---fdisk command---");
     
    18261776                                 format, -1);
    18271777            if (res) {
    1828                 mr_asprintf(tmp, "Failed to vacuum-pack %s", partition_name);
    1829                 log_it(tmp);
    1830                 mr_free(tmp);
     1778                log_it("Failed to vacuum-pack %s", partition_name);
    18311779
    18321780                retval++;
     
    18401788                                   partsize);
    18411789            if (retval) {
    1842                 mr_asprintf(tmp, "Partitioned %s but failed to set its type", partition_name);
    1843                 log_it(tmp);
    1844                 mr_free(tmp);
     1790                log_it("Partitioned %s but failed to set its type", partition_name);
    18451791            } else {
    18461792                if (partsize > 0) {
    1847                     mr_asprintf(tmp, "Partition %s created+configured OK", partition_name);
    1848                     log_to_screen(tmp);
    1849                     mr_free(tmp);
     1793                    log_to_screen("Partition %s created+configured OK", partition_name);
    18501794                } else {
    18511795                    log_it("Returning from a successful vacuum-pack");
     
    24252369        return;
    24262370    }
    2427     mr_asprintf(tmp, "Expanding entries to suit drive %s (%ld MB)", drive_name, current_size_of_drive);
    2428     log_to_screen(tmp);
    2429     mr_free(tmp);
     2371    log_to_screen("Expanding entries to suit drive %s (%ld MB)", drive_name, current_size_of_drive);
    24302372
    24312373    drivemntlist = malloc(sizeof(struct mountlist_reference));
     
    24452387
    24462388    if (original_size_of_drive <= 0) {
    2447         mr_asprintf(tmp, "Cannot resize %s's entries. Drive not found.", drive_name);
    2448         log_to_screen(tmp);
    2449         mr_free(tmp);
     2389        log_to_screen("Cannot resize %s's entries. Drive not found.", drive_name);
    24502390        return;
    24512391    }
    24522392    factor = (float) (current_size_of_drive) / (float) (original_size_of_drive);
    2453     mr_asprintf(tmp, "Disk %s was %ld MB; is now %ld MB; factor = %f", drive_name, original_size_of_drive, current_size_of_drive, factor);
    2454     log_to_screen(tmp);
    2455     mr_free(tmp);
     2393    log_to_screen("Disk %s was %ld MB; is now %ld MB; factor = %f", drive_name, original_size_of_drive, current_size_of_drive, factor);
    24562394
    24572395    lastpart = drivemntlist->entries - 1;
     
    24782416        }
    24792417
    2480         mr_asprintf(tmp, "Changing %s from %lld KB to %ld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL);
    2481         log_to_screen(tmp);
    2482         mr_free(tmp);
     2418        log_to_screen("Changing %s from %lld KB to %ld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL);
    24832419        drivemntlist->el[partno]->size = newsizL;
    24842420    }
    24852421    final_size = get_phys_size_of_drive(drive_name);
    2486     mr_asprintf(tmp, "final_size = %ld MB", final_size);
    2487     log_to_screen(tmp);
    2488     mr_free(tmp);
     2422    log_to_screen("final_size = %ld MB", final_size);
    24892423}
    24902424
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-compare.c

    r2323 r2324  
    7979            insist_on_this_cd_number((++g_current_media_number));
    8080        } else {
    81             mr_asprintf(tmp_ptr, "No CD's left. No biggiefiles left. No prob, Bob.");
    82             log_msg(2, tmp_ptr);
    83             paranoid_free(tmp_ptr);
     81            log_msg(2, "No CD's left. No biggiefiles left. No prob, Bob.");
    8482            return (0);
    8583        }
    8684    }
    8785    if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) {
    88         mr_asprintf(tmp_ptr, "Cannot open bigfile %ld (%s)'s info file", bigfileno + 1, bigfile_fname_ptr);
    89         log_to_screen(tmp_ptr);
    90         paranoid_free(tmp_ptr);
     86        log_to_screen("Cannot open bigfile %ld (%s)'s info file", bigfileno + 1, bigfile_fname_ptr);
    9187        return (1);
    9288    }
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2323 r2324  
    272272    if (!bkpinfo->isodir[0]) {
    273273        mr_free(bkpinfo->isodir);
    274         mr_asprintf(p, "/tmp/isodir");
    275         bkpinfo->isodir = p;
     274        mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
    276275    }
    277276    /* End patch */
     
    498497                "Again with the /proc - why is this in your mountlist?");
    499498        } else if (is_this_device_mounted(mountlist->el[lino].device)) {
    500             mr_asprintf(tmp, "%s is already mounted", mountlist->el[lino].device);
    501             log_to_screen(tmp);
    502             mr_free(tmp);
     499            log_to_screen("%s is already mounted", mountlist->el[lino].device);
    503500        } else if (strcmp(mountlist->el[lino].mountpoint, "none")
    504501           && strcmp(mountlist->el[lino].mountpoint, "lvm")
     
    595592        if (!strcmp(bkpinfo->isodir, "/") && am_I_in_disaster_recovery_mode()) {
    596593            mr_free(bkpinfo->isodir);
    597             mr_asprintf(p, "/tmp/isodir");
    598             bkpinfo->isodir = p;
     594            mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
    599595            log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    600596        }
     
    772768    mr_free(bkpinfo->prefix);
    773769    if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
    774         mr_asprintf(tmp1, "%s", value);
    775     } else {
    776         mr_asprintf(tmp1, "%s", STD_PREFIX);
    777     }
    778     bkpinfo->prefix = tmp1;
     770        mr_asprintf(bkpinfo->prefix, "%s", value);
     771    } else {
     772        mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX);
     773    }
    779774} else if (!strcmp(value, "nfs")) {
    780775    bkpinfo->backup_media_type = nfs;
     
    782777    mr_free(bkpinfo->prefix);
    783778    if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
    784         mr_asprintf(tmp1, "%s", value);
    785     } else {
    786         mr_asprintf(tmp1, "%s", STD_PREFIX);
    787     }
    788     bkpinfo->prefix = tmp1;
     779        mr_asprintf(bkpinfo->prefix, "%s", value);
     780    } else {
     781        mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX);
     782    }
    789783
    790784    if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) {
     
    796790        }
    797791        mr_free(bkpinfo->prefix);
    798         mr_asprintf(tmp1, "%s", envtmp1);
    799         bkpinfo->prefix = tmp1;
     792        mr_asprintf(bkpinfo->prefix, "%s", envtmp1);
    800793    }
    801794
     
    970963    read_cfg_var(g_mondo_cfg_file, "isodir", iso_path);
    971964    mr_free(bkpinfo->isodir);
    972     mr_asprintf(tmp1, "%s%s", iso_mnt, iso_path);
    973     bkpinfo->isodir = tmp1;
     965    mr_asprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
    974966    if (!bkpinfo->isodir[0]) {
    975967        mr_free(bkpinfo->isodir);
     
    20122004        }
    20132005        mr_asprintf(tmp, "Unmounting device %s  ", mountlist->el[lino].device);
    2014 
    20152006        update_progress_form(tmp);
    20162007
     
    21942185            }
    21952186            mr_asprintf(tmp, "%s", bkpinfo->media_device);
    2196             if (extract_cfg_file_and_mountlist_from_tape_dev
    2197                 (bkpinfo->media_device)) {
     2187            if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) {
    21982188                strcpy(bkpinfo->media_device, "/dev/st0");
    2199                 if (extract_cfg_file_and_mountlist_from_tape_dev
    2200                     (bkpinfo->media_device)) {
     2189                if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) {
    22012190                    strcpy(bkpinfo->media_device, "/dev/osst0");
    2202                     if (extract_cfg_file_and_mountlist_from_tape_dev
    2203                         (bkpinfo->media_device)) {
     2191                    if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) {
    22042192                        strcpy(bkpinfo->media_device, "/dev/ht0");
    2205                         if (extract_cfg_file_and_mountlist_from_tape_dev
    2206                             (bkpinfo->media_device)) {
    2207                             log_msg(3,
    2208                                     "I tried lots of devices but none worked.");
     2193                        if (extract_cfg_file_and_mountlist_from_tape_dev (bkpinfo->media_device)) {
     2194                            log_msg(3, "I tried lots of devices but none worked.");
    22092195                            strcpy(bkpinfo->media_device, tmp);
    22102196                        }
     
    23432329/* @} - end restoreUtilityGroup */
    23442330
    2345 
    2346 /***************************************************************************
    2347  * F@                                                                      *
    2348  * () -- Hugo Rabson                                  *
    2349  *                                                                         *
    2350  * Purpose:                                                                *
    2351  *                                                                         *
    2352  * Called by:                                                              *
    2353  * Params:    -                      -                                     *
    2354  * Returns:   0=success; nonzero=failure                                   *
    2355  ***************************************************************************/
    2356 
    2357 
    2358 
    23592331void wait_until_software_raids_are_prepped(char *mdstat_file,
    23602332                                           int wait_for_percentage)
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2323 r2324  
    918918        popup_and_OK(tmp);
    919919        mr_free(tmp);
    920         log_to_screen
    921           ("Mondo has restored your system. Please wait for the command prompt.");
    922         log_to_screen
    923             ("Then remove the backup media and reboot.");
    924         log_to_screen
    925             ("Please visit our website at http://www.mondorescue.org for more information.");
     920        log_to_screen("Mondo has restored your system. Please wait for the command prompt.");
     921        log_to_screen("Then remove the backup media and reboot.");
     922        log_to_screen("Please visit our website at http://www.mondorescue.org for more information.");
    926923    }
    927924    g_I_have_just_nuked = TRUE;
     
    11591156        use_ntfsprog_hack = TRUE;
    11601157        log_msg(2, "Calling ntfsclone in background because %s is an NTFS /dev entry", outfile_fname);
    1161         mr_asprintf(sz_devfile, "/tmp/%d.%d.000", (int) (random() % 32768),
    1162                 (int) (random() % 32768));
     1158        mr_asprintf(sz_devfile, "/tmp/%d.%d.000", (int) (random() % 32768), (int) (random() % 32768));
    11631159        mkfifo(sz_devfile, 0x770);
    11641160        strcpy(ntfsprog_fifo, sz_devfile);
     
    12321228            mr_free(mds);
    12331229
    1234             mr_asprintf(tmp, "Restoring from %s #%d", mds, g_current_media_number);
    1235             log_to_screen(tmp);
    1236             mr_free(tmp);
     1230            log_to_screen("Restoring from %s #%d", mds, g_current_media_number);
    12371231
    12381232            insist_on_this_cd_number(g_current_media_number);
     
    12791273            mr_free(tmp);
    12801274            if (bzip2_command != NULL) {
    1281                 mr_strcat(bzip2_command, " -dc %s 2>> %s",
    1282                         slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE);
     1275                mr_strcat(bzip2_command, " -dc %s 2>> %s", slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE);
    12831276            } else {
    1284                 mr_asprintf(bzip2_command, "cat %s 2>> %s",
    1285                         slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE);
     1277                mr_asprintf(bzip2_command, "cat %s 2>> %s", slice_fname(bigfileno, sliceno, ARCHIVES_PATH, suffix), MONDO_LOGFILE);
    12861278            }
    12871279            mds = media_descriptor_string(bkpinfo->backup_media_type);
     
    16271619    char *executable = NULL;
    16281620    char *temp_log = NULL;
    1629     char *screen_message = NULL;
    16301621    long matches = 0;
    16311622    bool use_star;
     
    16541645        log_msg(3, "length_of_file(%s) = %llu", tarball_fname, length_of_file(tarball_fname));
    16551646        log_msg(3, "count_lines_in_file(%s) = %llu", tarball_fname, count_lines_in_file(tarball_fname));
    1656         mr_asprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)", current_tarball_number);
    1657         log_to_screen(tmp);
    1658         mr_free(tmp);
     1647        log_to_screen("Unable to restore fileset #%ld (CD I/O error)", current_tarball_number);
    16591648        mr_free(filelist_name);
    16601649        log_msg(5, "Leaving");
     
    16721661            log_msg(3, "Saved fileset %ld's subset to %s", current_tarball_number, filelist_subset_fname);
    16731662        }
    1674         mr_asprintf(screen_message, "Tarball #%ld --- %ld matches", current_tarball_number, matches);
    1675         log_to_screen(screen_message);
    1676         mr_free(screen_message);
     1663        log_to_screen("Tarball #%ld --- %ld matches", current_tarball_number, matches);
    16771664    }
    16781665    mr_free(filelist_name);
     
    20662053            } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
    20672054                insist_on_this_cd_number(++g_current_media_number);
    2068                 mr_asprintf(tmp1, "Restoring from %s #%d", mds, g_current_media_number);
    2069                 log_to_screen(tmp1);
    2070                 mr_free(tmp1);
     2055                log_to_screen("Restoring from %s #%d", mds, g_current_media_number);
    20712056                just_changed_cds = TRUE;
    20722057            } else {
     
    22282213        } else {
    22292214            mr_asprintf(progress_str, "Restoring from fileset #%ld on %s #%d", current_tarball_number, mds, g_current_media_number);
    2230             for (res = 999, attempts = 0; attempts < 3 && res != 0;
    2231                  attempts++) {
    2232                 res =
    2233                     restore_a_tarball_from_CD(tarball_fname,
    2234                                               current_tarball_number,
    2235                                               filelist);
     2215            for (res = 999, attempts = 0; attempts < 3 && res != 0; attempts++) {
     2216                res = restore_a_tarball_from_CD(tarball_fname, current_tarball_number, filelist);
    22362217            }
    22372218            mr_asprintf(tmp1, "%s #%d, fileset #%ld - restore ", mds, g_current_media_number, current_tarball_number);
     
    22472228            }
    22482229            strcpy(comment, tmp1);
    2249             paranoid_free(tmp1);
     2230            mr_free(tmp1);
    22502231            if (attempts > 1) {
    22512232                log_to_screen(comment);
     
    25192500        retval += res;
    25202501        if (res) {
    2521             mr_asprintf(tmp, "Fileset %ld - errors occurred", current_afioball_number);
    2522             log_to_screen(tmp);
    2523             mr_free(tmp);
     2502            log_to_screen("Fileset %ld - errors occurred", current_afioball_number);
    25242503        }
    25252504        res =
     
    29582937                log_msg(1, "Mounting nfs dir");
    29592938                mr_free(bkpinfo->isodir);
    2960                 mr_asprintf(tmp, "/tmp/isodir");
    2961                 bkpinfo->isodir = tmp;
     2939                mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
    29622940                run_program_and_log_output("mkdir -p /tmp/isodir", 5);
    29632941                mr_asprintf(tmp, "mount %s -t nfs -o nolock,ro /tmp/isodir", bkpinfo->nfs_mount);
     
    29682946
    29692947        if (retval) {
    2970             log_to_screen
    2971                 ("Warning - load_raidtab_into_raidlist returned an error");
     2948            log_to_screen("Warning - load_raidtab_into_raidlist returned an error");
    29722949        }
    29732950
     
    30793056    set_signals(FALSE);
    30803057    log_to_screen("Restore log (%s) copied to /var/log on your hard disk", MONDO_LOGFILE);
    3081     mr_asprintf(tmp, "Mondo-restore is exiting (retval=%d)                                      ", retval);
    3082     log_to_screen(tmp);
    3083     mr_free(tmp);
     3058    log_to_screen("Mondo-restore is exiting (retval=%d)                                      ", retval);
    30843059
    30853060    mr_asprintf(tmp, "umount %s", bkpinfo->isodir);
Note: See TracChangeset for help on using the changeset viewer.