Changeset 687 in MondoRescue for trunk/mondo/mondo/common/libmondo-stream.c


Ignore:
Timestamp:
Jul 17, 2006, 3:39:42 PM (18 years ago)
Author:
bcornec
Message:

merge -r671:686 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/libmondo-stream.c

    r507 r687  
    156156    log_it("closeout_tape() -- entering");
    157157    retval +=
    158         write_header_block_to_stream(0, "end-of-backup",
     158        write_header_block_to_stream((off_t)0, "end-of-backup",
    159159                                     BLK_END_OF_BACKUP);
    160     retval += write_header_block_to_stream(0, "end-of-tape", BLK_END_OF_TAPE);  /* just in case */
     160    retval += write_header_block_to_stream((off_t)0, "end-of-tape", BLK_END_OF_TAPE);   /* just in case */
    161161    /* write 1MB of crap */
    162162    for (i = 0; i < 256 * 1024; i++) {
     
    166166        (void) fwrite(blk, 1, 256 * 1024, g_tape_stream);
    167167        if (should_we_write_to_next_tape
    168             (bkpinfo->media_size[g_current_media_number], 256 * 1024)) {
     168            (bkpinfo->media_size[g_current_media_number], (off_t)256 * 1024)) {
    169169            start_to_write_to_next_tape(bkpinfo);
    170170        }
     
    386386                                 BLK_START_EXAT_FILE);
    387387    write_file_to_stream_from_file(bkpinfo, xattr_fname);
    388     write_header_block_to_stream(-1, xattr_fname, BLK_STOP_EXAT_FILE);
     388    write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
    389389// acl
    390390    write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    391391                                 BLK_START_EXAT_FILE);
    392392    write_file_to_stream_from_file(bkpinfo, acl_fname);
    393     write_header_block_to_stream(-1, acl_fname, BLK_STOP_EXAT_FILE);
     393    write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
    394394    write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    395395                                 BLK_STOP_EXTENDED_ATTRIBUTES);
     
    10621062 * autodetecting the size. Huh?
    10631063 */
     1064
     1065/* BERLIOS: Should be reviewed for mediasize being a off_t ??? */
    10641066bool
    10651067should_we_write_to_next_tape(long mediasize,
    1066                              long long length_of_incoming_file)
     1068                             off_t length_of_incoming_file)
    10671069{
    10681070    /*@ bool's ***************************************************** */
     
    13031305    g_tape_posK = 0;
    13041306    g_sigpipe = FALSE;
    1305     res += write_header_block_to_stream(0, "start-of-tape", BLK_START_OF_TAPE); /* just in case */
    1306     res += write_header_block_to_stream(0, "start-of-backup", BLK_START_OF_BACKUP); /* just in case */
     1307    res += write_header_block_to_stream((off_t)0, "start-of-tape", BLK_START_OF_TAPE);  /* just in case */
     1308    res += write_header_block_to_stream((off_t)0, "start-of-backup", BLK_START_OF_BACKUP);  /* just in case */
    13071309    return (res);
    13081310}
     
    13431345            }
    13441346            if (i != last) {
    1345                 write_header_block_to_stream(0,
     1347                write_header_block_to_stream((off_t)0,
    13461348                                             "stop-backcatalog-afio-or-slice",
    13471349                                             BLK_STOP_AN_AFIO_OR_SLICE);
     
    14461448    long i;
    14471449
    1448     /*@ long long ************************************************** */
    1449     long long filesize;
     1450    off_t filesize;
    14501451
    14511452#ifdef EXTRA_TAPE_CHECKSUMS
     
    15211522    paranoid_fclose(fin);
    15221523    asprintf(&checksum, "%04x%04x", crc16, crctt);
    1523     write_header_block_to_stream(g_current_media_number, checksum,
     1524    /* BERLIOS: what does it do ??? */
     1525    write_header_block_to_stream((off_t)g_current_media_number, checksum,
    15241526                                 BLK_STOP_FILE);
    15251527    paranoid_free(checksum);
     
    15411543 */
    15421544int
    1543 write_header_block_to_stream(long long length_of_incoming_file,
     1545write_header_block_to_stream(off_t length_of_incoming_file,
    15441546                             char *filename, int control_char)
    15451547{
     
    15521554    int i;
    15531555
    1554     /*@ long long ************************************************** */
    1555     long long olen;
     1556    off_t olen;
    15561557
    15571558    /*@ end vars *************************************************** */
     
    15751576    sprintf(tempblock + 6000 + control_char, "Mondolicious, baby");
    15761577    tempblock[7000] = control_char;
    1577     memcpy(tempblock + 7001, (char *) &olen, sizeof(long long));
     1578    memcpy(tempblock + 7001, (char *) &olen, sizeof(off_t));
    15781579    strcpy(tempblock + 1000, filename);
    15791580    g_tape_posK +=
Note: See TracChangeset for help on using the changeset viewer.