Browse Source

Changed interface of helper function iso_tell_max_part_range()

release-1.5.4.branch
Thomas Schmitt 2 years ago
parent
commit
e1097dbb5d
  1. 9
      libisofs/ecma119.c
  2. 5
      libisofs/ecma119.h
  3. 9
      libisofs/system_area.c

9
libisofs/ecma119.c

@ -4604,12 +4604,13 @@ ex: /* LIBISO_ALLOC_MEM failed */
/* Determines the range of valid partition numbers depending on partition
table type.
*/
void iso_tell_max_part_range(Ecma119Image *target,
int *first_partition, int *last_partition)
void iso_tell_max_part_range(IsoWriteOpts *opts,
int *first_partition, int *last_partition,
int flag)
{
int sa_type;
sa_type = (target->system_area_options >> 2) & 0x3f;
sa_type = (opts->system_area_options >> 2) & 0x3f;
if (sa_type == 3) { /* SUN Disk Label */
*first_partition = 2;
*last_partition = 8;
@ -4628,7 +4629,7 @@ int iso_count_appended_partitions(Ecma119Image *target,
{
int i, count= 0;
iso_tell_max_part_range(target, first_partition, last_partition);
iso_tell_max_part_range(target->opts, first_partition, last_partition, 0);
for (i = *first_partition - 1; i <= *last_partition - 1; i++) {
if (target->opts->appended_partitions[i] == NULL)
continue;

5
libisofs/ecma119.h

@ -1058,7 +1058,8 @@ int iso_count_appended_partitions(Ecma119Image *target,
/* Determines the range of valid partition numbers depending on partition
table type.
*/
void iso_tell_max_part_range(Ecma119Image *target,
int *first_partition, int *last_partition);
void iso_tell_max_part_range(IsoWriteOpts *opts,
int *first_partition, int *last_partition,
int flag);
#endif /*LIBISO_ECMA119_H_*/

9
libisofs/system_area.c

@ -156,7 +156,7 @@ int iso_compute_append_partitions(Ecma119Image *t, int flag)
int first_partition, last_partition;
uint32_t pos, size, add_pos = 0;
off_t start_byte, byte_count;
char msg[80];
char msg[128];
sa_type = (t->system_area_options >> 2) & 0x3f;
cyl_align = (t->system_area_options >> 8) & 0x3;
@ -178,7 +178,7 @@ int iso_compute_append_partitions(Ecma119Image *t, int flag)
#endif
iso_tell_max_part_range(t, &first_partition, &last_partition);
iso_tell_max_part_range(t->opts, &first_partition, &last_partition, 0);
for (i = 0; i < ISO_MAX_PARTITIONS; i++) {
if (t->opts->appended_partitions[i] == NULL)
continue;
@ -1874,7 +1874,7 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf)
sa_type = (t->system_area_options >> 2) & 0x3f;
iso_tell_max_part_range(t, &first_partition, &last_partition);
iso_tell_max_part_range(t->opts, &first_partition, &last_partition, 0);
for (i = first_partition - 1; i <= last_partition - 1; i++)
if (t->opts->appended_partitions[i] != NULL) {
will_append = 1;
@ -3205,7 +3205,8 @@ static int partappend_writer_write_data(IsoImageWriter *writer)
target = writer->target;
/* Append partition data */
iso_tell_max_part_range(target, &first_partition, &last_partition);
iso_tell_max_part_range(target->opts,
&first_partition, &last_partition, 0);
for (i = first_partition - 1; i <= last_partition - 1; i++) {
if (target->opts->appended_partitions[i] == NULL)

Loading…
Cancel
Save