Ignore:
Timestamp:
Aug 11, 2008, 3:05:15 AM (16 years ago)
Author:
Bruno Cornec
Message:

Commit ald modifs in trunk - just in case

File:
1 edited

Legend:

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

    r1086 r2009  
    44*/
    55
     6#include <pthread.h>
    67#include "my-stuff.h"
    78#include "../common/mondostructures.h"
    89#include "../common/libmondo.h"
     10#include "mr_msg.h"
     11#include "mr_mem.h"
    912#include "mr-externs.h"
    1013#include "mondo-rstr-compare.h"
    1114#include "mondo-restore-EXT.h"
    1215#include "mondo-rstr-tools-EXT.h"
    13 #ifndef S_SPLINT_S
    14 #include <pthread.h>
    15 #endif
    16 #include "mr_mem.h"
     16
     17//static char cvsid[] = "$Id$";
    1718
    1819void popup_changelist_from_file(char *);
     
    3233{
    3334
    34     FILE *fin;
    35     FILE *fout;
     35    FILE *fin = NULL;
     36    FILE *fout = NULL;
    3637
    3738  /** needs malloc *******/
     
    6263    }
    6364    if (!(fin = fopen(tmp1, "r"))) {
    64         mr_asprintf(&tmp, _("Cannot open bigfile %ld (%s)'s info file"),
    65                 bigfileno + 1, tmp);
    66         log_to_screen(tmp);
    67         mr_free(tmp);
     65        log_to_screen(_("Cannot open bigfile %ld (%s)'s info file"),
     66                bigfileno + 1, tmp1);
    6867        mr_free(tmp1);
    6968        return (1);
     
    7473    paranoid_fclose(fin);
    7574
    76     mr_asprintf(&checksum, biggiestruct.checksum);
    7775    mr_asprintf(&bigfile_fname, biggiestruct.filename);
    78 
    7976    mr_msg(2, "biggiestruct.filename = %s", bigfile_fname);
    80     mr_msg(2, "biggiestruct.checksum = %s", checksum);
     77    if (!biggiestruct.checksum[0]) {
     78        mr_msg(2, "Warning - %s has no checksum", bigfile_fname);
     79    } else {
     80        mr_asprintf(&checksum, biggiestruct.checksum);
     81        mr_msg(2, "biggiestruct.checksum = %s", checksum);
     82    }
    8183
    8284    if (!g_text_mode) {
     
    8688        mr_free(tmp);
    8789    }
    88     /* BERLIOS: Useless ?
    89     if (!checksum[0]) {
    90         mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);
    91     } */
     90
    9291    if (!strncmp(bigfile_fname, "/dev/", 5)) {
    9392        mr_msg(2, _("Ignoring device %s"), bigfile_fname);
     93        mr_free(bigfile_fname);
    9494        return(0);
    95     } else {
    96         mr_asprintf(&command,
    97                 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors.txt",
    98                 MNT_RESTORING, bigfile_fname);
    99     }
     95    }
     96    mr_asprintf(&command,
     97            "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors.txt",
     98            MNT_RESTORING, bigfile_fname);
    10099    mr_msg(2, command);
    101     paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null");
    102100    if (system(command)) {
    103101        log_OS_error("Warning - command failed");
     102        paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null");
    104103        mr_free(command);
    105104        mr_free(bigfile_fname);
     
    157156{
    158157    int retval = 0;
    159     int res;
    160     long noof_biggiefiles, bigfileno = 0;
    161     char *tmp;
     158    int res = 0;
     159    long noof_biggiefiles = 0L, bigfileno = 0L;
     160    char *tmp = NULL;
    162161
    163162    assert(bkpinfo != NULL);
     
    186185        update_progress_form(tmp);
    187186        mr_free(tmp);
     187
    188188        res = compare_a_biggiefile(bkpinfo, bigfileno);
    189189        retval += res;
     
    218218{
    219219    int retval = 0;
    220     int res;
    221     long noof_lines;
    222     long archiver_errors;
    223     bool use_star;
    224 
    225   /***  needs malloc *********/
     220    int res = 0;
     221    long noof_lines = 0L;
     222    long archiver_errors = 0L;
     223    bool use_star = FALSE;
     224
    226225    char *command = NULL;
    227226    char *tmp = NULL;
     
    242241        mr_asprintf(&compressor_exe, "bzip2");
    243242    } else if (strstr(tarball_fname, ".gz")) {
    244         strcpy(compressor_exe, "gzip");
    245     } else if (strstr(tarball_fname, ".gz")) {
    246         strcpy(compressor_exe, "gzip");
     243        mr_asprintf(&compressor_exe, "gzip");
    247244    } else if (strstr(tarball_fname, ".lzo")) {
    248245        mr_asprintf(&compressor_exe, "lzop");
     
    275272        }
    276273    }
    277 // star -diff H=star -bz file=....
    278274
    279275#ifdef __FreeBSD__
     
    317313        archiver_errors = 0;
    318314    }
    319 
    320315    if (archiver_errors) {
    321         mr_asprintf(&tmp,
    322                 "Differences found while processing fileset #%d       ",
     316        mr_msg(1, "Differences found while processing fileset #%d       ",
    323317                current_tarball_number);
    324         mr_msg(1, tmp);
    325         mr_free(tmp);
    326318    }
    327319    unlink(logfile);
     
    343335{
    344336    int retval = 0;
    345     int res;
     337    int res = 0;
    346338    int current_tarball_number = 0;
    347 
    348   /**  needs malloc **********/
    349339
    350340    char *tarball_fname = NULL;
    351341    char *progress_str = NULL;
    352342    char *tmp = NULL;
    353     long max_val;
     343    long max_val = 0L;
    354344
    355345    assert(bkpinfo != NULL);
     
    415405        } else {
    416406            res = compare_a_tarball(tarball_fname, current_tarball_number);
    417             mr_free(tarball_fname);
    418 
    419407            g_current_progress++;
    420408            current_tarball_number++;
    421409        }
     410        mr_free(tarball_fname);
    422411    }
    423412    mr_free(progress_str);
     
    457446    int resA = 0;
    458447    int resB = 0;
    459     long noof_changed_files;
     448    long noof_changed_files = 0L;
    460449
    461450    malloc_string(cwd);
     
    475464    noof_changed_files = count_lines_in_file("/tmp/changed.txt");
    476465    if (noof_changed_files) {
    477         mr_asprintf(&tmp, _("%ld files do not match the backup            "),
     466        log_to_screen(_("%ld files do not match the backup            "),
    478467                noof_changed_files);
    479         //      mvaddstr_and_log_it( g_currentY++, 0, tmp );
    480         log_to_screen(tmp);
    481         mr_free(tmp);
    482 
    483468        mr_asprintf(&command, "cat /tmp/changed.txt >> %s", MONDO_LOGFILE);
    484469        paranoid_system(command);
     
    517502{
    518503    int retval = 0;
    519     long q;
    520     char *tmp;
     504    long q = 0L;
     505    char *tmp = NULL;
    521506
    522507  /**************************************************************************
     
    633618    run_program_and_log_output(command, FALSE);
    634619    mr_free(command);
     620
    635621    mvaddstr_and_log_it(g_currentY,
    636622                        0, _("Verifying archives against filesystem"));
     
    680666int compare_to_tape(struct s_bkpinfo *bkpinfo)
    681667{
    682     int res;
     668    int res = 0;
    683669    char *dir = NULL;
    684670    char *command = NULL;
Note: See TracChangeset for help on using the changeset viewer.