Refactor single exit point for rpmReadConfigFiles()

This commit is contained in:
Panu Matilainen 2013-02-20 10:22:04 +02:00
parent 6f76f4fa78
commit c47e343aa9
1 changed files with 8 additions and 3 deletions

View File

@ -1605,17 +1605,20 @@ exit:
int rpmReadConfigFiles(const char * file, const char * target)
{
int rc = -1; /* assume failure */
/* Force preloading of dlopen()'ed libraries in case we go chrooting */
(void) gethostbyname("localhost");
if (rpmInitCrypto())
return -1;
goto exit;
/* Preset target macros */
/* FIX: target can be NULL */
rpmRebuildTargetVars(&target, NULL);
/* Read the files */
if (rpmReadRC(file)) return -1;
if (rpmReadRC(file))
goto exit;
if (macrofiles != NULL) {
char *mf = rpmGetPath(macrofiles, NULL);
@ -1638,8 +1641,10 @@ int rpmReadConfigFiles(const char * file, const char * target)
/* Force Lua state initialization */
rpmLuaInit();
#endif
rc = 0;
return 0;
exit:
return rc;
}
int rpmShowRC(FILE * fp)