Flip logic to simplify code a bit

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2018-08-03 09:22:17 +02:00
parent 0f01cf7cff
commit ea586826be

View File

@ -210,34 +210,24 @@ extern int InitKsyms(mapfile)
/* /*
* Search for and open the file containing the kernel symbols. * Search for and open the file containing the kernel symbols.
*/ */
if ( mapfile != (char *) 0 ) if ( mapfile == (char *) 0 )
{
if ( (sym_file = fopen(mapfile, "r")) == (FILE *) 0 )
{
Syslog(LOG_WARNING, "Cannot open map file: %s.", \
mapfile);
return(0);
}
}
else
{ {
if ( (mapfile = FindSymbolFile()) == (char *) 0 ) if ( (mapfile = FindSymbolFile()) == (char *) 0 )
{ {
Syslog(LOG_WARNING, "Cannot find map file."); Syslog(LOG_WARNING, "Cannot find a map file.");
if ( debugging ) if ( debugging )
fputs("Cannot find map file.\n", stderr); fputs("Cannot find a map file.\n", stderr);
return(0);
}
if ( (sym_file = fopen(mapfile, "r")) == (FILE *) 0 )
{
Syslog(LOG_WARNING, "Cannot open map file.");
if ( debugging )
fputs("Cannot open map file.\n", stderr);
return(0); return(0);
} }
} }
if ( (sym_file = fopen(mapfile, "r")) == (FILE *) 0 )
{
Syslog(LOG_WARNING, "Cannot open map file: %s.", mapfile);
if ( debugging )
fprintf(stderr, "Cannot open map file: %s.\n", mapfile);
return(0);
}
/* /*
* Read the kernel symbol table file and add entries for each * Read the kernel symbol table file and add entries for each