Ignore:
Timestamp:
Sep 25, 2013, 8:55:43 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • Modification to 3.1 branch to make it extremely similar to 3.0. What remains are function rewrite with allocation in the function and desallocation outside of the function. Will be next step
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mondo/src/common/libmondo-stream.c

    r3161 r3190  
    193193        }
    194194        if (should_we_write_to_next_tape
    195             (bkpinfo->media_size[g_current_media_number], (off_t)256 * 1024)) {
     195            (bkpinfo->media_size, (off_t)256 * 1024)) {
    196196            start_to_write_to_next_tape();
    197197        }
     
    206206      {
    207207        fwrite (blk, 1, 256*1024, g_tape_stream);
    208         if (should_we_write_to_next_tape (bkpinfo->media_size[g_current_media_number], 256*1024))
     208        if (should_we_write_to_next_tape (bkpinfo->media_size, 256*1024))
    209209          {
    210210            start_to_write_to_next_tape ();
     
    278278        mr_asprintf(dev, "%s", VANILLA_SCSI_TAPE);
    279279        mr_free(tmp);
     280        mr_free(cdr_exe);
    280281        return(dev);
    281282    }
     
    288289    if (strlen(tmp) < 2) {
    289290        log_it("Could not find tape device");
     291        mr_free(cdr_exe);
    290292        mr_free(tmp);
    291293        return(NULL);
     
    295297    mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", cdr_exe);
    296298    mr_free(cdr_exe);
     299
    297300    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    298301    mr_free(command);
     
    812815    log_to_screen("Reading stream");
    813816    log_it("stream device = '%s'", bkpinfo->media_device);
    814 /* skip data disks */
     817    /* skip data disks */
    815818    open_evalcall_form("Skipping data disks on stream");
    816819    log_to_screen("Skipping data disks on stream");
     
    937940}
    938941if (bkpinfo->media_device == NULL) {
    939     log_it("Unable to openout NULL dvice");
     942    log_it("Unable to openout NULL device");
    940943    return(1);
    941944}
     
    13051308    char *pA;
    13061309    char *pB;
     1310    int res;
    13071311    int ctrl_chr;
    1308     int res;
    13091312    char *temp_fname;
    13101313    char *datablock;
     
    13251328    while (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) {
    13261329        res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr);
     1330        if (res) {
     1331            // FIXME
     1332        }
    13271333        if (ctrl_chr == BLK_START_AN_AFIO_OR_SLICE) {
    13281334            break;
     
    14721478    log_it("New tape requested.");
    14731479    insist_on_this_tape_number(g_current_media_number + 1); // will increment g_current_media, too
    1474     if (g_current_media_number > MAX_NOOF_MEDIA) {
    1475         res++;
    1476         log_to_screen("Too many tapes. Man, you need to use nfs!");
    1477     }
    14781480    if (bkpinfo->backup_media_type == cdstream) {
    14791481        mr_asprintf(command, "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s", bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE, MONDO_LOGFILE);
     
    16631665    filesize = length_of_file(infile);
    16641666    if (should_we_write_to_next_tape
    1665         (bkpinfo->media_size[g_current_media_number], filesize)) {
     1667        (bkpinfo->media_size, filesize)) {
    16661668        start_to_write_to_next_tape();
    16671669        write_backcatalog_to_tape();
Note: See TracChangeset for help on using the changeset viewer.