File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ restore_data_file(const char *from_root,
519
519
if (i == BLCKSZ )
520
520
goto skip_checksum ;
521
521
}
522
- ((PageHeader ) page .data )-> pd_checksum = pg_checksum_page (page .data , header .block );
522
+ ((PageHeader ) page .data )-> pd_checksum = pg_checksum_page (page .data , file -> segno * RELSEG_SIZE + header .block );
523
523
}
524
524
525
525
skip_checksum :
Original file line number Diff line number Diff line change @@ -547,7 +547,7 @@ dir_read_file_list(const char *root, const char *file_txt)
547
547
pg_crc32 crc ;
548
548
unsigned int mode ; /* bit length of mode_t depends on platforms */
549
549
struct tm tm ;
550
- pgFile * file ;
550
+ pgFile * file ;
551
551
552
552
memset (& tm , 0 , sizeof (tm ));
553
553
if (sscanf (buf , "%s %c %lu %u %o %d-%d-%d %d:%d:%d" ,
@@ -590,6 +590,30 @@ dir_read_file_list(const char *root, const char *file_txt)
590
590
strcpy (file -> path , path );
591
591
592
592
parray_append (files , file );
593
+
594
+ if (file -> is_datafile )
595
+ {
596
+ int find_dot ;
597
+ int check_digit ;
598
+ char * text_segno ;
599
+ size_t path_len = strlen (file -> path );
600
+ for (find_dot = path_len - 1 ; file -> path [find_dot ] != '.' && find_dot >= 0 ; find_dot -- );
601
+ if (find_dot <= 0 )
602
+ continue ;
603
+
604
+ text_segno = file -> path + find_dot + 1 ;
605
+ for (check_digit = 0 ; text_segno [check_digit ] != '\0' ; check_digit ++ )
606
+ if (!isdigit (text_segno [check_digit ]))
607
+ {
608
+ check_digit = -1 ;
609
+ break ;
610
+ }
611
+
612
+ if (check_digit == -1 )
613
+ continue ;
614
+
615
+ file -> segno = (int ) strtol (text_segno , NULL , 10 );
616
+ }
593
617
}
594
618
595
619
fclose (fp );
You can’t perform that action at this time.
0 commit comments