Ignore:
Timestamp:
Sep 24, 2007, 3:04:43 AM (12 years ago)
Author:
Bruno Cornec
Message:

Render bkpinfo global (potential issue on thread, but should not be a problem as that structure is indeed static during archive)
Should solve the tmpdir issue from previous rev.
May still not compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-compare.c

    r1644 r1645  
    6767extern char *MONDO_LOGFILE;
    6868
     69/* Reference to global bkpinfo */
     70extern struct s_bkpinfo *bkpinfo;
     71
    6972//static char cvsid[] = "$Id$";
    7073
     
    8285 * @note This function uses an MD5 checksum.
    8386 */
    84 int compare_a_biggiefile(struct s_bkpinfo *bkpinfo, long bigfileno)
     87int compare_a_biggiefile(long bigfileno)
    8588{
    8689
     
    127130    if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) {
    128131        if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
    129             insist_on_this_cd_number(bkpinfo, (++g_current_media_number));
     132            insist_on_this_cd_number((++g_current_media_number));
    130133        } else {
    131134            sprintf(tmp_ptr,
     
    230233/**
    231234 * Compare all biggiefiles in the backup.
    232  * @param bkpinfo The backup information structure. Used only in compare_a_biggiefile().
    233235 * @return 0 for success, nonzero for failure.
    234236 */
    235 int compare_all_biggiefiles(struct s_bkpinfo *bkpinfo)
     237int compare_all_biggiefiles()
    236238{
    237239    int retval = 0;
     
    240242    char tmp[MAX_STR_LEN];
    241243
    242     assert(bkpinfo != NULL);
    243244    log_msg(1, "Comparing biggiefiles");
    244245
     
    263264        log_msg(1, tmp);
    264265        update_progress_form(tmp);
    265         res = compare_a_biggiefile(bkpinfo, bigfileno);
     266        res = compare_a_biggiefile(bigfileno);
    266267        retval += res;
    267268        g_current_progress++;
     
    417418 * @return 0 for success, nonzero for failure.
    418419 */
    419 int compare_all_tarballs(struct s_bkpinfo *bkpinfo)
     420int compare_all_tarballs()
    420421{
    421422    int retval = 0;
     
    449450
    450451    for (;;) {
    451         insist_on_this_cd_number(bkpinfo, g_current_media_number);
     452        insist_on_this_cd_number(g_current_media_number);
    452453        update_progress_form(progress_str);
    453454        sprintf(tarball_fname,
     
    523524 * @return 0 for success, nonzero for failure.
    524525 */
    525 int compare_to_CD(struct s_bkpinfo *bkpinfo)
     526int compare_to_CD()
    526527{
    527528  /** needs malloc *********/
     
    541542    chdir(bkpinfo->restore_path);
    542543    getcwd(new, MAX_STR_LEN - 1);
    543     insist_on_this_cd_number(bkpinfo, g_current_media_number);
     544    insist_on_this_cd_number(g_current_media_number);
    544545    unlink(MINDI_CACHE"/changed.txt");
    545546
    546     resA = compare_all_tarballs(bkpinfo);
    547     resB = compare_all_biggiefiles(bkpinfo);
     547    resA = compare_all_tarballs();
     548    resB = compare_all_biggiefiles();
    548549    chdir(cwd);
    549550    noof_changed_files = count_lines_in_file(MINDI_CACHE"/changed.txt");
     
    586587 */
    587588int
    588 compare_mode(struct s_bkpinfo *bkpinfo,
    589              struct mountlist_itself *mountlist,
     589compare_mode(struct mountlist_itself *mountlist,
    590590             struct raidlist_itself *raidlist)
    591591{
     
    608608    assert(raidlist != NULL);
    609609
    610     while (get_cfg_file_from_archive(bkpinfo)) {
     610    while (get_cfg_file_from_archive()) {
    611611        if (!ask_me_yes_or_no
    612612            ("Failed to find config file/archives. Choose another source?"))
     
    614614            fatal_error("Unable to find config file/archives. Aborting.");
    615615        }
    616         interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
    617     }
    618 
    619     read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
     616        interactively_obtain_media_parameters_from_user(FALSE);
     617    }
     618
     619    read_cfg_file_into_bkpinfo(g_mondo_cfg_file);
    620620    g_current_media_number = 1;
    621621    mvaddstr_and_log_it(1, 30, "Comparing Automatically");
     
    629629    if (bkpinfo->backup_media_type == tape
    630630        || bkpinfo->backup_media_type == udev) {
    631         retval += compare_to_tape(bkpinfo);
     631        retval += compare_to_tape();
    632632    } else if (bkpinfo->backup_media_type == cdstream) {
    633         retval += compare_to_cdstream(bkpinfo);
    634     } else {
    635         retval += compare_to_CD(bkpinfo);
     633        retval += compare_to_cdstream();
     634    } else {
     635        retval += compare_to_CD();
    636636    }
    637637    if (retval) {
     
    695695 * @return 0 for success, nonzero for failure.
    696696 */
    697 int compare_to_cdstream(struct s_bkpinfo *bkpinfo)
     697int compare_to_cdstream()
    698698{
    699699    int res;
     
    721721        find_cdrom_device(bkpinfo->media_device, FALSE);
    722722    }
    723     res = verify_tape_backups(bkpinfo);
     723    res = verify_tape_backups();
    724724    chdir(dir);
    725725    if (length_of_file(MINDI_CACHE"/changed.txt") > 2
     
    754754 * returns: int                                                           *
    755755 **************************************************************************/
    756 int compare_to_tape(struct s_bkpinfo *bkpinfo)
     756int compare_to_tape()
    757757{
    758758    int res;
     
    770770    mvaddstr_and_log_it(g_currentY,
    771771                        0, "Verifying archives against filesystem");
    772     res = verify_tape_backups(bkpinfo);
     772    res = verify_tape_backups();
    773773    chdir(dir);
    774774    if (res) {
Note: See TracChangeset for help on using the changeset viewer.