More checking on function return

This commit is contained in:
Laurent Vivier 2006-05-29 20:23:18 +00:00
parent 7cf0906477
commit dc17cc55f7

View File

@ -109,12 +109,13 @@ void scanbus(void)
for (i = 0; i < count; i++)
{
int block_size, block_count;
int ret;
printf("%s:", devices[i]);
map = emile_map_open(devices[i], O_RDONLY);
emile_map_geometry(map, &block_size, &block_count);
if (verbose)
ret = emile_map_geometry(map, &block_size, &block_count);
if ((ret != -1) && verbose)
{
printf(" block size: %d, blocks number: %d (",
block_size, block_count);
@ -195,9 +196,13 @@ void scanbus(void)
int checksum;
char processor[16];
emile_map_get_partition_geometry(map,
&start, &count);
printf(" base: %d, count: %d (",
ret = emile_map_get_partition_geometry(map,
&start,
&count);
if( ret != -1)
{
printf(" base:"
" %d, count: %d (",
start, count);
print_size(count, 512);
printf(")\n");
@ -216,7 +221,7 @@ void scanbus(void)
printf(" "
"Checksum: 0x%04x, Processor: %s\n",
checksum, processor);
}
}
}
emile_map_close(map);