Changeset 687 in MondoRescue for trunk/mondo/mondo/common/libmondo-stream.c
- Timestamp:
- Jul 17, 2006, 3:39:42 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-stream.c
r507 r687 156 156 log_it("closeout_tape() -- entering"); 157 157 retval += 158 write_header_block_to_stream( 0, "end-of-backup",158 write_header_block_to_stream((off_t)0, "end-of-backup", 159 159 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 */ 161 161 /* write 1MB of crap */ 162 162 for (i = 0; i < 256 * 1024; i++) { … … 166 166 (void) fwrite(blk, 1, 256 * 1024, g_tape_stream); 167 167 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)) { 169 169 start_to_write_to_next_tape(bkpinfo); 170 170 } … … 386 386 BLK_START_EXAT_FILE); 387 387 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); 389 389 // acl 390 390 write_header_block_to_stream(length_of_file(acl_fname), acl_fname, 391 391 BLK_START_EXAT_FILE); 392 392 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); 394 394 write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname, 395 395 BLK_STOP_EXTENDED_ATTRIBUTES); … … 1062 1062 * autodetecting the size. Huh? 1063 1063 */ 1064 1065 /* BERLIOS: Should be reviewed for mediasize being a off_t ??? */ 1064 1066 bool 1065 1067 should_we_write_to_next_tape(long mediasize, 1066 long longlength_of_incoming_file)1068 off_t length_of_incoming_file) 1067 1069 { 1068 1070 /*@ bool's ***************************************************** */ … … 1303 1305 g_tape_posK = 0; 1304 1306 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 */ 1307 1309 return (res); 1308 1310 } … … 1343 1345 } 1344 1346 if (i != last) { 1345 write_header_block_to_stream( 0,1347 write_header_block_to_stream((off_t)0, 1346 1348 "stop-backcatalog-afio-or-slice", 1347 1349 BLK_STOP_AN_AFIO_OR_SLICE); … … 1446 1448 long i; 1447 1449 1448 /*@ long long ************************************************** */ 1449 long long filesize; 1450 off_t filesize; 1450 1451 1451 1452 #ifdef EXTRA_TAPE_CHECKSUMS … … 1521 1522 paranoid_fclose(fin); 1522 1523 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, 1524 1526 BLK_STOP_FILE); 1525 1527 paranoid_free(checksum); … … 1541 1543 */ 1542 1544 int 1543 write_header_block_to_stream( long longlength_of_incoming_file,1545 write_header_block_to_stream(off_t length_of_incoming_file, 1544 1546 char *filename, int control_char) 1545 1547 { … … 1552 1554 int i; 1553 1555 1554 /*@ long long ************************************************** */ 1555 long long olen; 1556 off_t olen; 1556 1557 1557 1558 /*@ end vars *************************************************** */ … … 1575 1576 sprintf(tempblock + 6000 + control_char, "Mondolicious, baby"); 1576 1577 tempblock[7000] = control_char; 1577 memcpy(tempblock + 7001, (char *) &olen, sizeof( long long));1578 memcpy(tempblock + 7001, (char *) &olen, sizeof(off_t)); 1578 1579 strcpy(tempblock + 1000, filename); 1579 1580 g_tape_posK +=
Note:
See TracChangeset
for help on using the changeset viewer.