Fixed a severe inode number mash-up from revision 554

and a minor bug introduced with revision 547 (for ticket 147).
This commit is contained in:
Thomas Schmitt 2009-05-06 16:18:45 +02:00
parent f8d3bca20a
commit c6f1101e9d
2 changed files with 29 additions and 2 deletions

View File

@ -904,6 +904,7 @@ int ecma119_node_cmp(const void *v1, const void *v2)
if (n1 == n2)
return 0;
/* Imported or explicite ISO image node id has absolute priority */
ret1 = (iso_node_get_id(n1->node, &fs_id1, &dev_id1, &ino_id1, 1) > 0);
ret2 = (iso_node_get_id(n2->node, &fs_id2, &dev_id2, &ino_id2, 1) > 0);
@ -922,7 +923,7 @@ int ecma119_node_cmp(const void *v1, const void *v2)
return 1;
if (n1->type == ECMA119_FILE) {
ret1 = iso_file_src_cmp(n2->info.file, n2->info.file);
ret1 = iso_file_src_cmp(n1->info.file, n2->info.file);
return ret1;
#ifdef Libisofs_hardlink_matcheR

View File

@ -675,7 +675,7 @@ IsoStream *iso_stream_get_input_stream(IsoStream *stream, int flag)
IsoStreamIface* class;
if (stream == NULL) {
return ISO_NULL_POINTER;
return NULL;
}
class = stream->class;
if (class->version < 2)
@ -737,6 +737,10 @@ int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag)
ino_t ino_id1, ino_id2;
off_t size1, size2;
/* <<< */
static int report_counter = 0;
static int debug = 1;
if (s1 == s2) {
return 0;
}
@ -760,8 +764,30 @@ int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag)
size1 = iso_stream_get_size(s1);
size2 = iso_stream_get_size(s2);
if (size1 < size2) {
if (debug) {
if (report_counter < 5)
fprintf(stderr,
"\n\nlibisofs_DEBUG : Program error: same ino but differing size\n\n\n");
else if (report_counter == 5)
fprintf(stderr,
"\n\nlibisofs_DEBUG : Inode error: more of same ino but differing size\n\n\n");
report_counter++;
}
return -1;
} else if (size1 > size2) {
if (debug) {
if (report_counter < 5)
fprintf(stderr,
"\n\nlibisofs_DEBUG : Inode error: same ino but differing size\n\n\n");
else if (report_counter == 5)
fprintf(stderr,
"\n\nlibisofs_DEBUG : Program error: more of same ino but differing size\n\n\n");
report_counter++;
}
return 1;
}