mirror of
https://github.com/vivier/EMILE.git
synced 2024-09-08 19:54:38 +00:00
More checking on function return
This commit is contained in:
parent
7cf0906477
commit
dc17cc55f7
@ -109,12 +109,13 @@ void scanbus(void)
|
|||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
int block_size, block_count;
|
int block_size, block_count;
|
||||||
|
int ret;
|
||||||
|
|
||||||
printf("%s:", devices[i]);
|
printf("%s:", devices[i]);
|
||||||
map = emile_map_open(devices[i], O_RDONLY);
|
map = emile_map_open(devices[i], O_RDONLY);
|
||||||
|
|
||||||
emile_map_geometry(map, &block_size, &block_count);
|
ret = emile_map_geometry(map, &block_size, &block_count);
|
||||||
if (verbose)
|
if ((ret != -1) && verbose)
|
||||||
{
|
{
|
||||||
printf(" block size: %d, blocks number: %d (",
|
printf(" block size: %d, blocks number: %d (",
|
||||||
block_size, block_count);
|
block_size, block_count);
|
||||||
@ -195,28 +196,32 @@ void scanbus(void)
|
|||||||
int checksum;
|
int checksum;
|
||||||
char processor[16];
|
char processor[16];
|
||||||
|
|
||||||
emile_map_get_partition_geometry(map,
|
ret = emile_map_get_partition_geometry(map,
|
||||||
&start, &count);
|
&start,
|
||||||
printf(" base: %d, count: %d (",
|
&count);
|
||||||
start, count);
|
if( ret != -1)
|
||||||
print_size(count, 512);
|
{
|
||||||
printf(")\n");
|
printf(" base:"
|
||||||
printf(" flags: 0x%08x\n",
|
" %d, count: %d (",
|
||||||
emile_map_partition_get_flags(map));
|
start, count);
|
||||||
emile_map_get_bootinfo(map, &bootstart,
|
print_size(count, 512);
|
||||||
&bootsize, &bootaddr,
|
printf(")\n");
|
||||||
&bootentry, &checksum,
|
printf(" flags: 0x%08x\n",
|
||||||
processor);
|
emile_map_partition_get_flags(map));
|
||||||
printf(" "
|
emile_map_get_bootinfo(map, &bootstart,
|
||||||
"Bootstart: %d, Bootsize: %d\n",
|
&bootsize, &bootaddr,
|
||||||
bootstart, bootsize);
|
&bootentry, &checksum,
|
||||||
printf(" "
|
processor);
|
||||||
"Bootaddr: %d, Bootentry: %d\n",
|
printf(" "
|
||||||
bootaddr, bootentry);
|
"Bootstart: %d, Bootsize: %d\n",
|
||||||
printf(" "
|
bootstart, bootsize);
|
||||||
"Checksum: 0x%04x, Processor: %s\n",
|
printf(" "
|
||||||
checksum, processor);
|
"Bootaddr: %d, Bootentry: %d\n",
|
||||||
|
bootaddr, bootentry);
|
||||||
|
printf(" "
|
||||||
|
"Checksum: 0x%04x, Processor: %s\n",
|
||||||
|
checksum, processor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emile_map_close(map);
|
emile_map_close(map);
|
||||||
|
Loading…
Reference in New Issue
Block a user