Ignore:
Timestamp:
Nov 10, 2012, 5:05:37 AM (11 years ago)
Author:
Bruno Cornec
Message:

r5035@localhost: bruno | 2012-11-09 03:17:01 +0100

  • Fix a compilation error and most compilation warnings
File:
1 edited

Legend:

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

    r3056 r3060  
    10231023    char *curr_acl_list_fname;
    10241024
    1025     struct s_bkpinfo *bkpinfo_bis;
    10261025    char *tmp;
    10271026    int res = 0, retval = 0;
     
    10411040    p_next_set_to_archive = (int *) (inbuf + 8);
    10421041    p_list_of_fileset_flags = (char *) (inbuf + 12);
    1043     bkpinfo_bis = (struct s_bkpinfo *) (inbuf + BKPINFO_LOC_OFFSET);
    10441042
    10451043    sprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ,
     
    15971595
    15981596    log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir);
    1599     (void) getcwd(old_pwd, MAX_STR_LEN - 1);
     1597    tmp1 = getcwd(old_pwd, MAX_STR_LEN - 1);
    16001598    mr_asprintf(&tmp, "chmod 700 %s", bkpinfo->scratchdir);
    16011599    run_program_and_log_output(tmp, FALSE);
    16021600    paranoid_free(tmp);
    1603     (void)chdir(bkpinfo->scratchdir);
     1601    if (chdir(bkpinfo->scratchdir)) {
     1602        // FIXME
     1603    }
    16041604
    16051605    mds = media_descriptor_string(bkpinfo->backup_media_type);
     
    16601660    }
    16611661
    1662     (void)chdir(old_pwd);
     1662    if (chdir(old_pwd)) {
     1663        // FIXME
     1664    }
    16631665    if (retval) {
    16641666        log_msg(1, "WARNING - make_usb_fs returned an error");
     
    17341736    log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",
    17351737            bkpinfo->scratchdir, destfile);
    1736     (void) getcwd(old_pwd, MAX_STR_LEN - 1);
     1738    tmp2 = getcwd(old_pwd, MAX_STR_LEN - 1);
    17371739    sprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir);
    17381740    run_program_and_log_output(tmp, FALSE);
    1739     chdir(bkpinfo->scratchdir);
     1741    if (chdir(bkpinfo->scratchdir)) {
     1742        // FIXME
     1743    }
    17401744
    17411745    if (bkpinfo->call_before_iso[0] != '\0') {
     
    17961800                /* reset error counter before trying to blank DVD */
    17971801                retval -= res;
    1798                 (void)system("sync");
     1802                paranoid_system("sync");
    17991803                pause_for_N_seconds(5, "Letting DVD drive settle");
    18001804
     
    19841988    }
    19851989
    1986     chdir(old_pwd);
     1990    if (chdir(old_pwd)) {
     1991        // FIXME
     1992    }
    19871993    if (retval) {
    19881994        log_msg(1, "WARNING - make_iso_fs returned an error");
     
    20402046    FILE *fin;
    20412047    char *p;
     2048    char *q;
    20422049
    20432050    /*@ buffers ******************************************** */
     
    20902097
    20912098    malloc_string(bigfile_fname);
    2092     for (fgets(bigfile_fname, MAX_STR_LEN, fin); !feof(fin);
    2093          fgets(bigfile_fname, MAX_STR_LEN, fin), biggie_file_number++) {
     2099    for (q = fgets(bigfile_fname, MAX_STR_LEN, fin); !feof(fin) && (q != NULL);
     2100         q = fgets(bigfile_fname, MAX_STR_LEN, fin), biggie_file_number++) {
    20942101        use_ntfsprog = FALSE;
    20952102        if (bigfile_fname[strlen(bigfile_fname) - 1] < 32) {
     
    26212628    /*@ long long ****************************************************** */
    26222629    off_t length_of_incoming_file = (off_t)0;
    2623     t_archtype type;
    26242630    va_list ap;
    26252631
     
    26432649        write_header_block_to_stream(length_of_incoming_file, curr_file,
    26442650                                     start_chr);
    2645         if (strstr(curr_file, ".afio.") || strstr(curr_file, ".star.")) {
    2646             type = fileset;
    2647         } else if (strstr(curr_file, "slice")) {
    2648             type = biggieslice;
    2649         } else {
    2650             type = other;
    2651         }
    26522651        res = write_file_to_stream_from_file(curr_file);
    26532652        retval += res;
     
    29772976    off_t totalread = (off_t)0;
    29782977    off_t totallength = (off_t)0;
    2979     off_t length;
    29802978
    29812979    /*@ int ******************************************************** */
     
    30363034        }
    30373035        mr_free(command);
    3038         (void) fgets(checksum_line, MAX_STR_LEN, fin);
     3036        tmp = fgets(checksum_line, MAX_STR_LEN, fin);
    30393037        pclose(fin);
    30403038        totallength = length_of_file (biggie_filename);
     
    30613059    paranoid_free(tmp);
    30623060
    3063     (void) fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout);
     3061    res = fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout);
    30643062    if (fout != NULL) {
    30653063        paranoid_fclose(fout);
    30663064    }
    3067     length = totallength / optimal_set_size / 1024;
    30683065    log_msg(1, "Opening in %s; slicing it and writing to CD/tape",
    30693066            file_to_openin);
     
    31103107                if (blksize > 0) {
    31113108                    totalread = totalread + blksize;
    3112                     (void) fwrite(tempblock, 1, blksize, fout);
     3109                    res = fwrite(tempblock, 1, blksize, fout);
    31133110                } else {
    31143111                    break;
     
    34173414                ("Please reboot from the 1st %s in Compare Mode, as a precaution.", mds);
    34183415            mr_free(mds);
    3419             chdir("/");
     3416            if (chdir("/")) {
     3417                // FIXME
     3418            }
    34203419            log_it("Before calling verification of image()");
    34213420            if (bkpinfo->backup_media_type == usb) {
     
    34973496    assert(bkpinfo != NULL);
    34983497    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    3499         chdir("/");
     3498        if (chdir("/")) {
     3499            // FIXME
     3500        }
    35003501        mvaddstr_and_log_it(g_currentY, 0,
    35013502                            "Verifying archives against live filesystem");
     
    35183519            find_cdrom_device(bkpinfo->media_device, FALSE);    // replace 0,0,0 with /dev/cdrom
    35193520        }
    3520         chdir("/");
     3521        if (chdir("/")) {
     3522            // FIXME
     3523        }
    35213524        for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) {
    35223525            if (cdno != g_current_media_number) {
     
    35413544        }
    35423545        mr_asprintf(&tmp, "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE);
    3543         (void)system(tmp);
     3546        res = system(tmp);
    35443547        mr_free(tmp);
    35453548
    35463549        mr_asprintf(&tmp, "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE);
    3547         (void)system(tmp);
     3550        res = system(tmp);
    35483551        mr_free(tmp);
    35493552        run_program_and_log_output("umount " MNT_CDROM, FALSE);
Note: See TracChangeset for help on using the changeset viewer.