Ignore:
Timestamp:
Aug 18, 2009, 3:13:54 PM (15 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
File:
1 edited

Legend:

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

    r2323 r2324  
    202202
    203203    if (!does_file_exist(filelist)) {
    204         mr_asprintf(tmp, "(archive_this_fileset) - filelist %s does not exist", filelist);
    205         log_to_screen(tmp);
    206         paranoid_free(tmp);
     204        log_to_screen("(archive_this_fileset) - filelist %s does not exist", filelist);
    207205        return (1);
    208206    }
     
    210208    mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname);
    211209    if (system(tmp)) {
    212         paranoid_free(tmp);
     210        mr_free(tmp);
    213211        fatal_error("Unable to write tarball to scratchdir");
    214212    }
    215213    paranoid_free(tmp);
    216214
    217     mr_asprintf(command, "star H=star list=%s -c " STAR_ACL_SZ " file=%s",
    218             filelist, fname);
     215    mr_asprintf(command, "star H=star list=%s -c " STAR_ACL_SZ " file=%s", filelist, fname);
    219216    if (bkpinfo->use_lzo) {
     217        mr_free(command);
    220218        fatal_error("Can't use lzop");
    221219    }
     
    237235            res = 0;
    238236        }
    239         paranoid_free(tmp);
     237        mr_free(tmp);
    240238
    241239        if (res) {
     
    253251        }
    254252    }
    255     paranoid_free(command);
     253    mr_free(command);
    256254
    257255    retval += res;
     
    309307
    310308    if (!does_file_exist(filelist)) {
    311         mr_asprintf(tmp, "(archive_this_fileset) - filelist %s does not exist",
    312                 filelist);
    313         log_to_screen(tmp);
    314         paranoid_free(tmp);
     309        log_to_screen("(archive_this_fileset) - filelist %s does not exist", filelist);
    315310        return (1);
    316311    }
    317312    mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname);
    318313    if (system(tmp)) {
    319         paranoid_free(tmp);
     314        mr_free(tmp);
    320315        fatal_error("Unable to write tarball to scratchdir");
    321316    }
    322     paranoid_free(tmp);
     317    mr_free(tmp);
    323318
    324319
     
    326321        mr_asprintf(tmp, "%s/do-not-compress-these", g_mondo_home);
    327322        //       -b %ld, TAPE_BLOCK_SIZE
    328         mr_asprintf(zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->zip_exe,
    329                 bkpinfo->compression_level);
     323        mr_asprintf(zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->zip_exe, bkpinfo->compression_level);
    330324        if (does_file_exist(tmp)) {
    331325            mr_strcat(zipparams, " -E %s",tmp);
     
    333327            log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);
    334328        }
    335         paranoid_free(tmp);
     329        mr_free(tmp);
    336330    } else {
    337331        mr_asprintf(zipparams, "");
     
    346340        fatal_error("scratchdir not found");
    347341    }
    348     mr_asprintf(command, "rm -f %s %s. %s.gz %s.%s", fname, fname, fname,
    349             fname, bkpinfo->zip_suffix);
     342    mr_asprintf(command, "rm -f %s %s. %s.gz %s.%s", fname, fname, fname, fname, bkpinfo->zip_suffix);
    350343    paranoid_system(command);
    351     paranoid_free(command);
     344    mr_free(command);
    352345
    353346    mr_asprintf(command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s", TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE);
    354     paranoid_free(zipparams);
     347    mr_free(zipparams);
    355348
    356349    mr_asprintf(tmp, "echo hi > %s 2> /dev/null", fname);
    357350    if (system(tmp)) {
    358         paranoid_free(tmp);
     351        mr_free(tmp);
    359352        fatal_error("Unable to write tarball to scratchdir");
    360353    }
    361     paranoid_free(tmp);
     354    mr_free(tmp);
    362355
    363356    for (res = 99, tries = 0; tries < 3 && res != 0; tries++) {
     
    545538        mr_free(tmp);
    546539
    547         mr_asprintf(tmp, "devs_to_exclude = '%s'", devs_to_exclude);
    548         log_msg(2, tmp);
    549         mr_free(tmp);
     540        log_msg(2, "devs_to_exclude = '%s'", devs_to_exclude);
    550541    }
    551542
     
    557548        mr_asprintf(tmp, "%s/tmpfs/filelist.full", bkpinfo->tmpdir);
    558549        if (!does_file_exist(tmp)) {
    559             fatal_error
    560                 ("Cannot find filelist.full, so I cannot count its lines");
     550            mr_free(tmp);
     551            fatal_error ("Cannot find filelist.full, so I cannot count its lines");
    561552        }
    562553    }
     
    623614
    624615#ifdef __FreeBSD__
    625         mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    626                ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"));
     616        mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"));
    627617        if (!bootdev[0]) {
    628618            mr_free(bootdev);
    629             mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    630                    ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"));
     619            mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"));
    631620        }
    632621#else
    633622        /* Linux */
    634623#ifdef __IA64__
    635         mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    636                ("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));
     624        mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));
    637625#else
    638         mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    639                ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));
     626        mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));
    640627#endif
    641628        if (strstr(bootdev, "/dev/cciss/")) {
    642629            mr_free(bootdev);
    643630#ifdef __IA64__
    644             mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    645                    ("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));
     631            mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));
    646632#else
    647             mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    648                    ("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));
     633            mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));
    649634#endif
    650635        }
    651636        if (!bootdev[0]) {
    652637            mr_free(bootdev);
    653             mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    654                    ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));
     638            mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));
    655639            if (strstr(bootdev, "/dev/cciss/")) {
    656640                mr_free(bootdev);
    657                 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output
    658                        ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));
     641                mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));
    659642            }
    660643        }
     
    666649            ch = 'U';
    667650        if (bkpinfo->boot_loader != '\0') {
    668             mr_asprintf(tmp, "User specified boot loader. It is '%c'.", bkpinfo->boot_loader);
    669             log_msg(2, tmp);
    670             mr_free(tmp);
     651            log_msg(2, "User specified boot loader. It is '%c'.", bkpinfo->boot_loader);
    671652        } else {
    672653            bkpinfo->boot_loader = ch;
    673654        }
    674655        if (bkpinfo->boot_device[0] != '\0') {
    675             mr_asprintf(tmp, "User specified boot device. It is '%s'.", bkpinfo->boot_device);
    676             log_msg(2, tmp);
    677             mr_free(tmp);
     656            log_msg(2, "User specified boot device. It is '%s'.", bkpinfo->boot_device);
    678657        } else {
    679658            strcpy(bkpinfo->boot_device, bootdev);
     
    698677        mr_asprintf(bootldr_str, "LILO");
    699678        if (!does_file_exist("/etc/lilo.conf")) {
    700             fatal_error
    701                 ("The de facto standard location for your boot loader's config file is /etc/lilo.conf but I cannot find it there. What is wrong with your Linux distribution?");
     679            fatal_error("The de facto standard location for your boot loader's config file is /etc/lilo.conf but I cannot find it there. What is wrong with your Linux distribution?");
    702680        }
    703681    } else if (bkpinfo->boot_loader == 'G') {
    704682        mr_asprintf(bootldr_str, "GRUB");
    705         if (!does_file_exist("/boot/grub/menu.lst")
    706             && does_file_exist("/boot/grub/grub.conf")) {
    707             run_program_and_log_output
    708                 ("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5);
     683        if (!does_file_exist("/boot/grub/menu.lst") && does_file_exist("/boot/grub/grub.conf")) {
     684            run_program_and_log_output("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5);
    709685        }
    710686        if (!does_file_exist("/boot/grub/menu.lst")) {
    711             fatal_error
    712                 ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst but I cannot find it there. What is wrong with your Linux distribution?");
     687            fatal_error("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst but I cannot find it there. What is wrong with your Linux distribution?");
    713688        }
    714689    } else if (bkpinfo->boot_loader == 'E') {
    715690        mr_asprintf(bootldr_str, "ELILO");
    716691        /* BCO: fix it for Debian, Mandrake, ... */
    717         if (!does_file_exist("/etc/elilo.conf")
    718             && does_file_exist("/boot/efi/efi/redhat/elilo.conf")) {
    719             run_program_and_log_output
    720                 ("ln -sf /boot/efi/efi/redhat/elilo.conf /etc/elilo.conf",
    721                  5);
    722         }
    723         if (!does_file_exist("/etc/elilo.conf")
    724             && does_file_exist("/boot/efi/efi/SuSE/elilo.conf")) {
    725             run_program_and_log_output
    726                 ("ln -sf /boot/efi/efi/SuSE/elilo.conf /etc/elilo.conf",
    727                  5);
    728         }
    729         if (!does_file_exist("/etc/elilo.conf")
    730             && does_file_exist("/boot/efi/efi/debian/elilo.conf")) {
    731             run_program_and_log_output
    732                 ("ln -sf /boot/efi/efi/debian/elilo.conf /etc/elilo.conf",
    733                  5);
    734         }
    735         if (!does_file_exist("/etc/elilo.conf")
    736             && does_file_exist("/boot/efi/debian/elilo.conf")) {
    737             run_program_and_log_output
    738                 ("ln -sf /boot/efi/debian/elilo.conf /etc/elilo.conf",
    739                  5);
     692        if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/efi/redhat/elilo.conf")) {
     693            run_program_and_log_output("ln -sf /boot/efi/efi/redhat/elilo.conf /etc/elilo.conf", 5);
     694        }
     695        if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/efi/SuSE/elilo.conf")) {
     696            run_program_and_log_output("ln -sf /boot/efi/efi/SuSE/elilo.conf /etc/elilo.conf", 5);
     697        }
     698        if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/efi/debian/elilo.conf")) {
     699            run_program_and_log_output ("ln -sf /boot/efi/efi/debian/elilo.conf /etc/elilo.conf", 5);
     700        }
     701        if (!does_file_exist("/etc/elilo.conf") && does_file_exist("/boot/efi/debian/elilo.conf")) {
     702            run_program_and_log_output ("ln -sf /boot/efi/debian/elilo.conf /etc/elilo.conf", 5);
    740703        }
    741704        if (!does_file_exist("/etc/elilo.conf")) {
    742             fatal_error
    743                 ("The de facto mondo standard location for your boot loader's config file is /etc/elilo.conf but I cannot find it there. What is wrong with your Linux distribution? Try finding it under /boot/efi and do 'ln -s /boot/efi/..../elilo.conf /etc/elilo.conf'");
     705            fatal_error("The de facto mondo standard location for your boot loader's config file is /etc/elilo.conf but I cannot find it there. What is wrong with your Linux distribution? Try finding it under /boot/efi and do 'ln -s /boot/efi/..../elilo.conf /etc/elilo.conf'");
    744706        }
    745707    } else if (bkpinfo->boot_loader == 'R') {
     
    758720        mr_asprintf(bootldr_str, "unknown");
    759721    }
    760     mr_asprintf(tmp, "Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device);
    761     log_to_screen(tmp);
    762     mr_free(tmp);
     722    log_to_screen("Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device);
    763723
    764724    mr_asprintf(tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir);
     
    808768    if (write_one_liner_data_file(tmp, value)) {
    809769        res++;
    810         log_msg(1, "%ld: Unable to write one-liner backup-media-type",
    811                 __LINE__);
     770        log_msg(1, "%ld: Unable to write one-liner backup-media-type", __LINE__);
    812771    }
    813772    mr_free(value);
     
    817776    if (write_one_liner_data_file(tmp, bootldr_str)) {
    818777        res++;
    819         log_msg(1, "%ld: Unable to write one-liner bootloader.name",
    820                 __LINE__);
     778        log_msg(1, "%ld: Unable to write one-liner bootloader.name", __LINE__);
    821779    }
    822780    mr_free(bootldr_str);
     
    837795                __LINE__);
    838796        }
    839         paranoid_free(tmp1);
     797        mr_free(tmp1);
    840798    }
    841799    if (g_getfacl) {
    842800        mr_asprintf(tmp1, "%s/ACL", bkpinfo->tmpdir);
    843801        if (write_one_liner_data_file(tmp1, "TRUE")) {
    844             log_msg(1, "%ld: Unable to write one-liner ACL",
    845                 __LINE__);
    846         }
    847         paranoid_free(tmp1);
     802            log_msg(1, "%ld: Unable to write one-liner ACL", __LINE__);
     803        }
     804        mr_free(tmp1);
    848805    }
    849806    if (bkpinfo->use_obdr) {
    850807        mr_asprintf(tmp1, "%s/OBDR", bkpinfo->tmpdir);
    851808        if (write_one_liner_data_file(tmp1, "TRUE")) {
    852             log_msg(1, "%ld: Unable to write one-liner OBDR",
    853                 __LINE__);
    854         }
    855         paranoid_free(tmp1);
     809            log_msg(1, "%ld: Unable to write one-liner OBDR", __LINE__);
     810        }
     811        mr_free(tmp1);
    856812    }
    857813
    858814    estimated_total_noof_slices =
    859815        size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1;
    860     /* add nfs stuff here? */
     816    /* BERLIOS: add nfs stuff here? */
    861817    mr_asprintf(command, "mkdir -p %s/images", bkpinfo->scratchdir);
    862818    if (system(command)) {
     
    867823    log_msg(1, "lines_in_filelist = %ld", lines_in_filelist);
    868824
    869     mr_asprintf(command,
    870825/*     "mindi --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \
    8718266=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \
    87282711=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/
    873     mr_asprintf(&command, "mindi %s --custom %s %s/images '%s' '%s' \
    874 '%s' %ld '%s' '%s' '%s' \
     828    mr_asprintf(command, "mindi %s --custom %s %s/images '%s' '%s' '%s' %ld '%s' '%s' '%s' \
    875829'%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", tmp2, bkpinfo->tmpdir,    // parameter #2
    876830            bkpinfo->scratchdir,    // parameter #3
     
    923877        log_msg(2, command);
    924878        run_program_and_log_output(command, FALSE);
    925         paranoid_free(command);
     879        mr_free(command);
    926880
    927881        if (bkpinfo->nonbootable_backup) {
    928882            mr_asprintf(command, "cp -f %s/all.tar.gz %s/images", bkpinfo->tmpdir, bkpinfo->scratchdir);
    929883            if (system(command)) {
    930                 paranoid_free(command);
     884                mr_free(command);
    931885                fatal_error("Unable to create temporary all tarball");
    932886            }
    933             paranoid_free(command);
     887            mr_free(command);
    934888        }
    935889        /* For USB we already have everything on the key */
     
    937891            mr_asprintf(command, "rm -rf %s/images", bkpinfo->scratchdir);
    938892            run_program_and_log_output(command, FALSE);
    939             paranoid_free(command);
     893            mr_free(command);
    940894        } else {
    941895            mr_asprintf(tmp, "cp -f %s/images/all.tar.gz %s", bkpinfo->scratchdir, bkpinfo->tmpdir);
    942896            if (system(tmp)) {
     897                mr_free(tmp);
    943898                fatal_error("Cannot find all.tar.gz in tmpdir");
    944899            }
     
    954909        mr_asprintf(command, "grep 'Fatal error' /var/log/mindi.log");
    955910        mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
    956         paranoid_free(command);
     911        mr_free(command);
    957912
    958913        if (strlen(tmp) > 1) {
     
    10921047
    10931048        if (res) {
    1094             mr_asprintf(tmp, "Errors occurred while archiving set %ld. Please review logs.", archiving_set_no);
    1095             log_to_screen(tmp);
    1096             mr_free(tmp);
     1049            log_to_screen("Errors occurred while archiving set %ld. Please review logs.", archiving_set_no);
    10971050        }
    10981051        if (!semaphore_p()) {
     
    14701423                mr_free(media_usage_comment);
    14711424                if (res) {
    1472                     mr_asprintf(tmp, "Failed to add archive %ld's files to CD dir\n", storing_set_no);
    1473                     log_to_screen(tmp);
    1474                     paranoid_free(tmp);
    1475                     fatal_error
    1476                         ("Is your hard disk full? If not, please send the author the logfile.");
     1425                    log_to_screen("Failed to add archive %ld's files to CD dir\n", storing_set_no);
     1426                    fatal_error("Is your hard disk full? If not, please send the author the logfile.");
    14771427                }
    14781428                storing_set_no++;
     
    15041454    }
    15051455    log_to_screen(tmp);
    1506     paranoid_free(tmp);
     1456    mr_free(tmp);
    15071457
    15081458    paranoid_free(transfer_block);
     
    15581508    mr_asprintf(tmp, "chmod 755 %s", bkpinfo->scratchdir);
    15591509    run_program_and_log_output(tmp, FALSE);
    1560     paranoid_free(tmp);
     1510    mr_free(tmp);
    15611511    (void)chdir(bkpinfo->scratchdir);
    15621512
     
    15711521        mr_asprintf(tmp, "umount %s", tmp1);
    15721522        run_program_and_log_output(tmp, FALSE);
    1573         paranoid_free(tmp);
    1574     }
    1575     paranoid_free(tmp);
     1523        mr_free(tmp);
     1524    }
     1525    mr_free(tmp1);
    15761526
    15771527    log_msg(1, "Mounting USB device.");
     
    15791529    mr_asprintf(tmp, "mkdir -p %s", tmp1);
    15801530    run_program_and_log_output(tmp, FALSE);
    1581     paranoid_free(tmp);
     1531    mr_free(tmp);
     1532
    15821533    /* Mindi always create one single parition on the USB dev */
    15831534    mr_asprintf(tmp, "mount %s1 %s", bkpinfo->media_device, tmp1);
    15841535    run_program_and_log_output(tmp, FALSE);
    1585     paranoid_free(tmp);
     1536    mr_free(tmp);
    15861537
    15871538    if (bkpinfo->nonbootable_backup) {
     
    15991550        }
    16001551        log_to_screen(result_sz);
    1601         paranoid_free(result_sz);
    1602         paranoid_free(tmp);
     1552        mr_free(result_sz);
     1553        mr_free(tmp);
    16031554        retval += res;
    16041555
     
    16061557        mr_asprintf(tmp,"mkdir %s/archive", bkpinfo->scratchdir);
    16071558        run_program_and_log_output(tmp, FALSE);
    1608         paranoid_free(tmp);
     1559        mr_free(tmp);
    16091560    }
    16101561    paranoid_free(message_to_screen);
     
    16141565        mr_asprintf(tmp, "umount %s1", bkpinfo->media_device);
    16151566        run_program_and_log_output(tmp, FALSE);
    1616         paranoid_free(tmp);
     1567        mr_free(tmp);
    16171568    }
    16181569
     
    16951646    if (bkpinfo->call_before_iso[0] != '\0') {
    16961647        mr_asprintf(message_to_screen, "Running pre-ISO call for CD#%d", g_current_media_number);
    1697         res =
    1698             eval_call_to_make_ISO(bkpinfo->call_before_iso,
    1699                                   destfile, g_current_media_number,
    1700                                   MONDO_LOGFILE, message_to_screen);
     1648        res = eval_call_to_make_ISO(bkpinfo->call_before_iso, destfile, g_current_media_number, MONDO_LOGFILE, message_to_screen);
    17011649        if (res) {
    17021650            mr_strcat(message_to_screen, "...failed");
     
    20151963    log_to_screen(tmp);
    20161964    noof_biggie_files = count_lines_in_file(biggielist_fname);
    2017     open_progress_form("Backing up big files", tmp,
    2018                        "Please wait. This may take some time.", "",
    2019                        estimated_total_noof_slices);
    2020     paranoid_free(tmp);
     1965    open_progress_form("Backing up big files", tmp, "Please wait. This may take some time.", "", estimated_total_noof_slices);
     1966    mr_free(tmp);
    20211967
    20221968    if (!(fin = fopen(biggielist_fname, "r"))) {
     
    21272073        }
    21282074#endif
    2129         paranoid_free(tmp);
     2075        mr_free(tmp);
    21302076    }
    21312077    log_msg(1, "Finished backing up bigfiles");
     
    21952141        retval += res;
    21962142        if (res) {
    2197             mr_asprintf(tmp, "Errors occurred while archiving set %ld. Perhaps your live filesystem changed?", curr_set_no);
    2198             log_to_screen(tmp);
    2199             mr_free(tmp);
     2143            log_to_screen("Errors occurred while archiving set %ld. Perhaps your live filesystem changed?", curr_set_no);
    22002144        }
    22012145
     
    22472191
    22482192        if (res) {
    2249             mr_asprintf(tmp, "Failed to add archive %ld's files to CD dir\n", curr_set_no);
    2250             log_to_screen(tmp);
    2251             mr_free(tmp);
    2252             fatal_error
    2253                 ("Is your hard disk is full? If not, please send the author the logfile.");
     2193            log_to_screen("Failed to add archive %ld's files to CD dir\n", curr_set_no);
     2194            fatal_error("Is your hard disk is full? If not, please send the author the logfile.");
    22542195        }
    22552196        mr_free(curr_filelist_fname);
     
    26822623
    26832624    mds = media_descriptor_string(g_backup_media_type);
    2684     mr_asprintf(tmp, "I am about to burn %s #%d", mds, g_current_media_number);
     2625    log_to_screen("I am about to burn %s #%d", mds, g_current_media_number);
    26852626    mr_free(mds);
    2686     log_to_screen(tmp);
    2687     mr_free(tmp);
    26882627    if (g_current_media_number < ask_for_one_if_more_than_this) {
    26892628        return;
     
    29932932    if (!(fin = fopen(file_to_openin, "r"))) {
    29942933        log_OS_error("Unable to openin biggie_filename");
    2995         mr_asprintf(tmp, "Cannot archive bigfile '%s': not found", biggie_filename);
    2996         log_to_screen(tmp);
    2997         paranoid_free(tmp);
     2934        log_to_screen("Cannot archive bigfile '%s': not found", biggie_filename);
    29982935
    29992936        paranoid_free(checksum_line);
     
    31153052        retval += res;
    31163053        if (res) {
    3117             mr_asprintf(tmp, "Failed to add slice %ld of bigfile %ld to scratchdir", slice_num, biggie_file_number + 1);
    3118             log_to_screen(tmp);
    3119             paranoid_free(tmp);
    3120             fatal_error
    3121                 ("Hard disk full. You should have bought a bigger one.");
     3054            log_to_screen("Failed to add slice %ld of bigfile %ld to scratchdir", slice_num, biggie_file_number + 1);
     3055            fatal_error("Hard disk full. You should have bought a bigger one.");
    31223056        }
    31233057    }
     
    31323066    }
    31333067    log_msg(1, tmp);
    3134     paranoid_free(tmp);
     3068    mr_free(tmp);
    31353069
    31363070    paranoid_free(checksum_line);
     
    33103244    if (space_occupied_by_cd(bkpinfo->scratchdir) / 1024 >
    33113245        bkpinfo->media_size[g_current_media_number]) {
    3312         mr_asprintf(tmp1, "Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.", (long) space_occupied_by_cd(bkpinfo->scratchdir), (long) bkpinfo->media_size[g_current_media_number]);
    3313         log_to_screen(tmp1);
    3314         mr_free(tmp1);
     3246        log_to_screen("Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.", (long) space_occupied_by_cd(bkpinfo->scratchdir), (long) bkpinfo->media_size[g_current_media_number]);
    33153247    }
    33163248    mr_asprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     
    33773309    mr_asprintf(tmp1, "rm -Rf %s/images/*gz %s/images/*data*img", bkpinfo->scratchdir, bkpinfo->scratchdir);
    33783310    if (system(tmp1)) {
    3379         log_msg
    3380             (2,
    3381              "Error occurred when I tried to delete the redundant IMGs and GZs");
     3311        log_msg(2, "Error occurred when I tried to delete the redundant IMGs and GZs");
    33823312    }
    33833313    mr_free(tmp1);
     
    34553385            if (res) {
    34563386                mds = media_descriptor_string(bkpinfo->backup_media_type);
    3457                 mr_asprintf(tmp, "Warnings/errors were reported while checking %s #%d", mds, g_current_media_number);
     3387                log_to_screen("Warnings/errors were reported while checking %s #%d", mds, g_current_media_number);
    34583388                mr_free(mds);
    3459                 log_to_screen(tmp);
    3460                 mr_free(tmp);
    34613389
    34623390            }
Note: See TracChangeset for help on using the changeset viewer.