mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID: 65 - Fixes for configure.in for cross compilation
Commit is practically a re-work of ipmi_ek_display_fru_header() in order to eliminate warnings. Check those return values! Commit for Dan Gora
This commit is contained in:
parent
55524327ce
commit
c49bc06c39
@ -2368,42 +2368,37 @@ ipmi_ek_get_resource_descriptor( int port_count, int index,
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
static int
|
static int
|
||||||
ipmi_ek_display_fru_header( char * filename )
|
ipmi_ek_display_fru_header(char * filename)
|
||||||
{
|
{
|
||||||
FILE * input_file;
|
FILE * input_file;
|
||||||
/* this structure is declared in ipmi_fru.h */
|
struct fru_header header;
|
||||||
struct fru_header header;
|
int ret = 0;
|
||||||
int return_status = ERROR_STATUS;
|
|
||||||
|
|
||||||
input_file = fopen ( filename, "r");
|
input_file = fopen(filename, "r");
|
||||||
if ( input_file == NULL ){
|
if (input_file == NULL) {
|
||||||
lprintf(LOG_ERR, "file: '%s' is not found", filename);
|
lprintf(LOG_ERR, "File '%s' not found.", filename);
|
||||||
return_status = ERROR_STATUS;
|
return (ERROR_STATUS);
|
||||||
}
|
}
|
||||||
else{
|
ret = fread(&header, sizeof (struct fru_header), 1, input_file);
|
||||||
if ( !feof (input_file) ){
|
if ((ret != 1) || ferror(input_file)) {
|
||||||
fread ( &header, sizeof (struct fru_header), 1, input_file );
|
lprintf(LOG_ERR, "Failed to read FRU header!");
|
||||||
printf("%s\n", EQUAL_LINE_LIMITER);
|
return (ERROR_STATUS);
|
||||||
printf("FRU Header Info\n");
|
}
|
||||||
printf("%s\n", EQUAL_LINE_LIMITER);
|
printf("%s\n", EQUAL_LINE_LIMITER);
|
||||||
printf("Format Version :0x%02x %s\n", (header.version & 0x0f),
|
printf("FRU Header Info\n");
|
||||||
((header.version & 0x0f)==1) ? "" : "{unsupported}");
|
printf("%s\n", EQUAL_LINE_LIMITER);
|
||||||
printf("Internal Use Offset :0x%02x\n", header.offset.internal);
|
printf("Format Version :0x%02x %s\n",
|
||||||
printf("Chassis Info Offset :0x%02x\n", header.offset.chassis);
|
(header.version & 0x0f),
|
||||||
printf("Board Info Offset :0x%02x\n", header.offset.board);
|
((header.version & 0x0f) == 1) ? "" : "{unsupported}");
|
||||||
printf("Product Info Offset :0x%02x\n", header.offset.product);
|
printf("Internal Use Offset :0x%02x\n", header.offset.internal);
|
||||||
printf("MultiRecord Offset :0x%02x\n", header.offset.multi);
|
printf("Chassis Info Offset :0x%02x\n", header.offset.chassis);
|
||||||
printf("Common header Checksum :0x%02x\n", header.checksum);
|
printf("Board Info Offset :0x%02x\n", header.offset.board);
|
||||||
|
printf("Product Info Offset :0x%02x\n", header.offset.product);
|
||||||
|
printf("MultiRecord Offset :0x%02x\n", header.offset.multi);
|
||||||
|
printf("Common header Checksum :0x%02x\n", header.checksum);
|
||||||
|
|
||||||
return_status = OK_STATUS;
|
fclose(input_file);
|
||||||
}
|
return OK_STATUS;
|
||||||
else{
|
|
||||||
lprintf(LOG_ERR, "Invalid FRU header!");
|
|
||||||
return_status = ERROR_STATUS;
|
|
||||||
}
|
|
||||||
fclose( input_file );
|
|
||||||
}
|
|
||||||
return return_status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user