- Timestamp:
- Jun 26, 2006, 1:12:48 PM (19 years ago)
- Location:
- branches/stable/mondo/mondo
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/mondo/common/libmondo-archive.c
r681 r684 1364 1364 mvaddstr_and_log_it(g_currentY++, 74, "Done."); 1365 1365 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 1366 write_header_block_to_stream( 0, "start-of-tape",1366 write_header_block_to_stream((off_t)0, "start-of-tape", 1367 1367 BLK_START_OF_TAPE); 1368 write_header_block_to_stream( 0, "start-of-backup",1368 write_header_block_to_stream((off_t)0, "start-of-backup", 1369 1369 BLK_START_OF_BACKUP); 1370 1370 } … … 2175 2175 bool delete_when_done; 2176 2176 bool use_ntfsprog; 2177 /*@ long long ****************************************** */ 2178 long long biggie_fsize; 2177 off_t biggie_fsize; 2179 2178 2180 2179 assert(bkpinfo != NULL); … … 2274 2273 noof_biggie_files, use_ntfsprog); 2275 2274 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2276 write_header_block_to_stream( 0,2275 write_header_block_to_stream((off_t)0, 2277 2276 calc_checksum_of_file 2278 2277 (bigfile_fname), … … 2461 2460 2462 2461 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2463 write_header_block_to_stream( 0, "start-of-afioballs",2462 write_header_block_to_stream((off_t)0, "start-of-afioballs", 2464 2463 BLK_START_AFIOBALLS); 2465 2464 #if __FreeBSD__ == 5 … … 2470 2469 res = make_afioballs_and_images_OLD(bkpinfo); 2471 2470 #endif 2472 write_header_block_to_stream( 0, "stop-afioballs",2471 write_header_block_to_stream((off_t)0, "stop-afioballs", 2473 2472 BLK_STOP_AFIOBALLS); 2474 2473 } else { … … 2543 2542 res += write_EXAT_files_to_tape(bkpinfo, xattr_fname, acl_fname); 2544 2543 sprintf(blah, "%ld", count_lines_in_file(biggielist)); 2545 write_header_block_to_stream( 0, blah, BLK_START_BIGGIEFILES);2544 write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES); 2546 2545 } 2547 2546 res = make_slices_and_images(bkpinfo, biggielist); 2548 2547 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2549 write_header_block_to_stream( 0, "end-of-biggiefiles",2548 write_header_block_to_stream((off_t)0, "end-of-biggiefiles", 2550 2549 BLK_STOP_BIGGIEFILES); 2551 2550 } … … 2931 2930 char *curr_file, *cf; 2932 2931 /*@ long long ****************************************************** */ 2933 long long length_of_incoming_file =0;2932 off_t length_of_incoming_file = (off_t)0; 2934 2933 t_archtype type; 2935 2934 va_list ap; … … 2966 2965 unlink(curr_file); 2967 2966 /* write closing header */ 2968 write_header_block_to_stream( 0, "finished-writing-file", stop_chr);2967 write_header_block_to_stream((off_t)0, "finished-writing-file", stop_chr); 2969 2968 } 2970 2969 va_end(ap); … … 3306 3305 3307 3306 /*@ long long ************************************************** */ 3308 long long totalread =0;3309 long long totallength =0;3310 long longlength;3307 off_t totalread = (off_t)0; 3308 off_t totallength = (off_t)0; 3309 off_t length; 3311 3310 3312 3311 /*@ int ******************************************************** */ … … 3360 3359 strcpy (tmp, call_program_and_get_last_line_of_output(command)); 3361 3360 log_it("res of it = %s", tmp); 3362 totallength = atoll(tmp);3361 totallength = (off_t)atoll(tmp); 3363 3362 } else { 3364 3363 file_to_openin = biggie_filename; -
branches/stable/mondo/mondo/common/libmondo-files-EXT.h
r128 r684 16 16 extern int grab_percentage_from_last_line_of_file(char *filename); 17 17 extern char *last_line_of_file(char *filename); 18 extern long longlength_of_file(char *filename);18 extern off_t length_of_file(char *filename); 19 19 extern int make_checksum_list_file(char *filelist, char *cksumlist, 20 20 char *comppath); -
branches/stable/mondo/mondo/common/libmondo-files.c
r681 r684 596 596 * @return The length of the file, or -1 for error. 597 597 */ 598 long longlength_of_file(char *filename)598 off_t length_of_file(char *filename) 599 599 { 600 600 /*@ pointers *************************************************** */ … … 602 602 603 603 /*@ long long ************************************************* */ 604 long longlength;604 off_t length; 605 605 606 606 fin = fopen(filename, "r"); … … 611 611 } 612 612 fseeko(fin, 0, SEEK_END); 613 length = ftell (fin);613 length = ftello(fin); 614 614 paranoid_fclose(fin); 615 615 return (length); … … 641 641 642 642 /*@ long [long] ************************************************* */ 643 long longfilelist_length;644 longcurr_pos;643 off_t filelist_length; 644 off_t curr_pos; 645 645 long start_time; 646 646 long current_time; … … 680 680 counter = 0; 681 681 curr_fname[37] = '\0'; 682 curr_pos = ftell (fin) / 1024;682 curr_pos = ftello(fin) / 1024; 683 683 percentage = (int) (curr_pos * 100 / filelist_length); 684 684 time_taken = current_time - start_time; … … 921 921 } 922 922 } else { 923 /* BERLIOS: more than long here ??? */ 923 924 file_len_K = (long) (length_of_file(fname) / 1024); 924 925 } -
branches/stable/mondo/mondo/common/libmondo-files.h
r128 r684 19 19 int grab_percentage_from_last_line_of_file(char *filename); 20 20 char *last_line_of_file(char *filename); 21 long longlength_of_file(char *filename);21 off_t length_of_file(char *filename); 22 22 int make_checksum_list_file(char *filelist, char *cksumlist, 23 23 char *comppath); -
branches/stable/mondo/mondo/common/libmondo-fork.c
r541 r684 616 616 // if (bytes_read_in!=128+64) { fatal_error("Can't read the terminating block"); } 617 617 fwrite(tmp, 1, bytes_read_in, ftmp); 618 sprintf(tmp, "I am here - %l d", ftell(fin));618 sprintf(tmp, "I am here - %llu", ftello(fin)); 619 619 // log_msg(0, tmp); 620 620 fread(tmp, 1, 512, fin); -
branches/stable/mondo/mondo/common/libmondo-stream-EXT.h
r128 r684 26 26 char *fn); 27 27 extern bool should_we_write_to_next_tape(long mediasize, 28 long long28 off_t 29 29 length_of_incoming_file); 30 30 extern int skip_incoming_files_until_we_find_this_one(char … … 36 36 extern int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo, 37 37 char *infile); 38 extern int write_header_block_to_stream( long longlength_of_incoming_file,38 extern int write_header_block_to_stream(off_t length_of_incoming_file, 39 39 char *filename, int control_char); 40 40 extern void wrong_marker(int should_be, int it_is); -
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); -
branches/stable/mondo/mondo/common/libmondo-stream.h
r128 r684 26 26 char *fn); 27 27 bool should_we_write_to_next_tape(long mediasize, 28 long longlength_of_incoming_file);28 off_t length_of_incoming_file); 29 29 int skip_incoming_files_until_we_find_this_one(char 30 30 *the_file_I_was_reading); … … 35 35 int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo, 36 36 char *infile); 37 int write_header_block_to_stream( long longlength_of_incoming_file,37 int write_header_block_to_stream(off_t length_of_incoming_file, 38 38 char *filename, int control_char); 39 39 void wrong_marker(int should_be, int it_is); -
branches/stable/mondo/mondo/common/libmondo-verify.h
r128 r684 34 34 extern int grab_percentage_from_last_line_of_file(char *); 35 35 extern char *last_line_of_file(char *); 36 extern long longlength_of_file(char *);36 extern off_t length_of_file(char *); 37 37 extern void log_file_end_to_screen(char *, char *); 38 38 extern void log_tape_pos(void); -
branches/stable/mondo/mondo/mondorestore/mondo-restore.c
r676 r684 1985 1985 if (count_lines_in_file(filelist_name) <= 0 1986 1986 || length_of_file(tarball_fname) <= 0) { 1987 log_msg(3, "length_of_file(%s) = %l d", tarball_fname,1987 log_msg(3, "length_of_file(%s) = %llu", tarball_fname, 1988 1988 length_of_file(tarball_fname)); 1989 1989 sprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)", -
branches/stable/mondo/mondo/mondorestore/mondoprep.h
r558 r684 39 39 extern int strcmp_inc_numbers(char *, char *); 40 40 extern long count_lines_in_file(char *); 41 extern long longlength_of_file(char *);41 extern off_t length_of_file(char *); 42 42 extern long noof_lines_that_match_wildcard(char *, char *); 43 43 //extern char *slice_fname (long, long, bool, char *); -
branches/stable/mondo/mondo/mondorestore/mr-externs.h
r558 r684 36 36 extern void initialize_raid_record(struct raid_device_record *); 37 37 extern bool is_this_device_mounted(char *); 38 extern long longlength_of_file(char *);38 extern off_t length_of_file(char *); 39 39 extern char *last_line_of_file(char *); 40 40 extern struct s_node *load_filelist(char *);
Note:
See TracChangeset
for help on using the changeset viewer.