Ignore:
Timestamp:
Sep 19, 2007, 9:32:00 AM (17 years ago)
Author:
Bruno Cornec
Message:

Continue to use configuration file data (may not compile)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1628 r1638  
    438438    read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
    439439    iamhere("Done loading config file; resizing ML");
     440    mr_asprintf(&tmp,bkpinfo->prefix);
    440441    if (popup_and_get_string
    441         ("Prefix", "Prefix of your ISO images ?", bkpinfo->prefix, MAX_STR_LEN / 4)) {
     442        ("Prefix", "Prefix of your ISO images ?", tmp, MAX_STR_LEN / 4)) {
     443        mr_free(bkpinfo->prefix);
     444        bkpinfo->prefix = tmp;
    442445        mr_msg(1, "Prefix set to %s",bkpinfo->prefix);
    443446    }
     
    10381041
    10391042    pathname_of_last_file_restored[0] = '\0';
    1040     bigblk = mr_malloc(TAPE_BLOCK_SIZE);
     1043    bigblk = mr_malloc(mr_conf->external_tape_blocksize);
    10411044
    10421045    if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) {
     
    12491252
    12501253            while (!feof(fbzip2)) {
    1251                 siz = fread(bigblk, 1, TAPE_BLOCK_SIZE, fbzip2);
     1254                siz = fread(bigblk, 1, mr_conf->external_tape_blocksize, fbzip2);
    12521255                if (siz > 0) {
    12531256                    siz = fwrite(bigblk, 1, siz, fout);
     
    15671570    char *xattr_fname = NULL;
    15681571    char *acl_fname = NULL;
     1572#ifdef __FreeBSD__
     1573    long BUFSIZE=512L;
     1574#else
     1575    long BUFSIZE=(1024L*1024L)/mr_conf->external_tape_blocksize;
     1576#endif
     1577
    15691578
    15701579    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
     
    16511660            mr_free(tmp);
    16521661        }
    1653 #ifdef __FreeBSD__
    1654 #define BUFSIZE 512
    1655 #else
    1656 #define BUFSIZE (1024L*1024L)/TAPE_BLOCK_SIZE
    1657 #endif
    1658 
    16591662        if (use_star) {
    16601663            mr_asprintf(&command,
     
    16681671                mr_asprintf(&command,
    16691672                        "afio -i -M 8m -b %ld -c %ld %s -w '%s' %s",
    1670                         TAPE_BLOCK_SIZE,
     1673                        mr_conf->external_tape_blocksize,
    16711674                        BUFSIZE, executable, filelist_subset_fname,
    16721675                        tarball_fname);
     
    16741677                mr_asprintf(&command,
    16751678                        "afio -i -b %ld -c %ld -M 8m %s %s",
    1676                         TAPE_BLOCK_SIZE,
     1679                        mr_conf->external_tape_blocksize,
    16771680                        BUFSIZE, executable, tarball_fname);
    16781681            }
     
    16801683        mr_free(executable);
    16811684
    1682 #undef BUFSIZE
    16831685        mr_asprintf(&temp_log, "/tmp/%d.%d", (int) (random() % 32768),
    16841686            (int) (random() % 32768));
     
    18411843        } else {
    18421844            use_star = FALSE;
    1843             mr_asprintf(&command, "afio -t -M 8m -b %ld %s %s", TAPE_BLOCK_SIZE,
     1845            mr_asprintf(&command, "afio -t -M 8m -b %ld %s %s", mr_conf->external_tape_blocksize,
    18441846                    executable, afio_fname);
    18451847        }
     
    18831885        // afio
    18841886        if (filelist) {
    1885             mr_asprintf(&command, "afio -i -M 8m -b %ld %s -w %s %s 2>> %s", TAPE_BLOCK_SIZE, executable, filelist_subset_fname, afio_fname, MONDO_LOGFILE);
     1887            mr_asprintf(&command, "afio -i -M 8m -b %ld %s -w %s %s 2>> %s", mr_conf->external_tape_blocksize, executable, filelist_subset_fname, afio_fname, MONDO_LOGFILE);
    18861888        } else {
    1887             mr_asprintf(&command, "afio -i -M 8m -b %ld %s %s 2>> %s", TAPE_BLOCK_SIZE, executable, afio_fname, MONDO_LOGFILE);
     1889            mr_asprintf(&command, "afio -i -M 8m -b %ld %s %s 2>> %s", mr_conf->external_tape_blocksize, executable, afio_fname, MONDO_LOGFILE);
    18881890        }
    18891891    }
Note: See TracChangeset for help on using the changeset viewer.