Changeset 684 in MondoRescue for branches/stable/mondo/mondo/common/libmondo-stream.c
- Timestamp:
- Jun 26, 2006, 1:12:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/mondo/common/libmondo-stream.c
r541 r684 259 259 log_it("closeout_tape() -- entering"); 260 260 retval += 261 write_header_block_to_stream( 0, "end-of-backup",261 write_header_block_to_stream((off_t)0, "end-of-backup", 262 262 BLK_END_OF_BACKUP); 263 retval += write_header_block_to_stream( 0, "end-of-tape", BLK_END_OF_TAPE); /* just in case */263 retval += write_header_block_to_stream((off_t)0, "end-of-tape", BLK_END_OF_TAPE); /* just in case */ 264 264 /* write 1MB of crap */ 265 265 for (i = 0; i < 256 * 1024; i++) { … … 269 269 (void) fwrite(blk, 1, 256 * 1024, g_tape_stream); 270 270 if (should_we_write_to_next_tape 271 (bkpinfo->media_size[g_current_media_number], 256 * 1024)) {271 (bkpinfo->media_size[g_current_media_number], (off_t)256 * 1024)) { 272 272 start_to_write_to_next_tape(bkpinfo); 273 273 } … … 490 490 BLK_START_EXAT_FILE); 491 491 write_file_to_stream_from_file(bkpinfo, xattr_fname); 492 write_header_block_to_stream( -1, xattr_fname, BLK_STOP_EXAT_FILE);492 write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE); 493 493 // acl 494 494 write_header_block_to_stream(length_of_file(acl_fname), acl_fname, 495 495 BLK_START_EXAT_FILE); 496 496 write_file_to_stream_from_file(bkpinfo, acl_fname); 497 write_header_block_to_stream( -1, acl_fname, BLK_STOP_EXAT_FILE);497 write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE); 498 498 write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname, 499 499 BLK_STOP_EXTENDED_ATTRIBUTES); … … 1196 1196 * autodetecting the size. Huh? 1197 1197 */ 1198 1199 /* BERLIOS: Should be reviewed for mediasize being a off_t ??? */ 1198 1200 bool 1199 1201 should_we_write_to_next_tape(long mediasize, 1200 long longlength_of_incoming_file)1202 off_t length_of_incoming_file) 1201 1203 { 1202 1204 /*@ bool's ***************************************************** */ … … 1434 1436 g_tape_posK = 0; 1435 1437 g_sigpipe = FALSE; 1436 res += write_header_block_to_stream( 0, "start-of-tape", BLK_START_OF_TAPE); /* just in case */1437 res += write_header_block_to_stream( 0, "start-of-backup", BLK_START_OF_BACKUP); /* just in case */1438 res += write_header_block_to_stream((off_t)0, "start-of-tape", BLK_START_OF_TAPE); /* just in case */ 1439 res += write_header_block_to_stream((off_t)0, "start-of-backup", BLK_START_OF_BACKUP); /* just in case */ 1438 1440 return (res); 1439 1441 } … … 1477 1479 } 1478 1480 if (i != last) { 1479 write_header_block_to_stream( 0,1481 write_header_block_to_stream((off_t)0, 1480 1482 "stop-backcatalog-afio-or-slice", 1481 1483 BLK_STOP_AN_AFIO_OR_SLICE); … … 1582 1584 long i; 1583 1585 1584 /*@ long long ************************************************** */ 1585 long long filesize; 1586 off_t filesize; 1586 1587 1587 1588 #ifdef EXTRA_TAPE_CHECKSUMS … … 1658 1659 paranoid_fclose(fin); 1659 1660 sprintf(checksum, "%04x%04x", crc16, crctt); 1660 write_header_block_to_stream(g_current_media_number, checksum, 1661 /* BERLIOS: what does it do ??? */ 1662 write_header_block_to_stream((off_t)g_current_media_number, checksum, 1661 1663 BLK_STOP_FILE); 1662 1664 // log_it("File '%s' written to tape.", infile); … … 1680 1682 */ 1681 1683 int 1682 write_header_block_to_stream( long longlength_of_incoming_file,1684 write_header_block_to_stream(off_t length_of_incoming_file, 1683 1685 char *filename, int control_char) 1684 1686 { … … 1691 1693 int i; 1692 1694 1693 /*@ long long ************************************************** */ 1694 long long olen; 1695 off_t olen; 1695 1696 1696 1697 /*@ end vars *************************************************** */ … … 1715 1716 tempblock[7000] = control_char; 1716 1717 /* for(i=0;i<8;i++) {tempblock[7001+i]=olen&0xff; olen>>=8;} */ 1717 memcpy(tempblock + 7001, (char *) &olen, sizeof( long long));1718 memcpy(tempblock + 7001, (char *) &olen, sizeof(off_t)); 1718 1719 /* if (length_of_incoming_file) {memcpy(tempblock+7001,(char*)&length_of_incoming_file,sizeof(long long));} */ 1719 1720 strcpy(tempblock + 1000, filename);
Note:
See TracChangeset
for help on using the changeset viewer.