summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-21 11:37:21 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-21 11:37:21 +0300
commit8f7874c1933fc1dff36685d13abfedda56ca9ab7 (patch)
treede372b5d494ad0a7de7357f28bf1316701a3adfe /build
parent2fb15a5443c6a1461a53309d3d4ace598996d8b2 (diff)
downloadrpm-8f7874c1933fc1dff36685d13abfedda56ca9ab7.tar.gz
rpm-8f7874c1933fc1dff36685d13abfedda56ca9ab7.tar.bz2
rpm-8f7874c1933fc1dff36685d13abfedda56ca9ab7.zip
Fix up bunch of silly int vs rpmRC return code mismatches
Diffstat (limited to 'build')
-rw-r--r--build/files.c23
-rw-r--r--build/pack.c2
-rw-r--r--build/policies.c6
-rw-r--r--build/rpmbuild_internal.h6
-rw-r--r--build/rpmfc.c12
5 files changed, 24 insertions, 25 deletions
diff --git a/build/files.c b/build/files.c
index d74542983..5b1a8d1d8 100644
--- a/build/files.c
+++ b/build/files.c
@@ -361,7 +361,7 @@ static rpmRC parseForDev(const char * buf, FileList fl)
const char * name;
const char * errstr = NULL;
char *p, *pe, *q = NULL;
- int rc = RPMRC_FAIL; /* assume error */
+ rpmRC rc = RPMRC_FAIL; /* assume error */
if ((p = strstr(buf, (name = "%dev"))) == NULL)
return RPMRC_OK;
@@ -862,7 +862,7 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf,
FileList fl, const char ** fileName)
{
char *s, *t;
- int res;
+ rpmRC res;
char *specialDocBuf = NULL;
*fileName = NULL;
@@ -1526,7 +1526,7 @@ static rpmRC recurseDir(FileList fl, const char * diskPath)
FTS * ftsp;
FTSENT * fts;
int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL);
- int rc = RPMRC_FAIL;
+ rpmRC rc = RPMRC_FAIL;
fl->isDir = 1; /* Keep it from following myftw() again */
@@ -1544,7 +1544,7 @@ static rpmRC recurseDir(FileList fl, const char * diskPath)
break;
case FTS_DOT: /* dot or dot-dot */
case FTS_DP: /* postorder directory */
- rc = 0;
+ rc = RPMRC_OK;
break;
case FTS_NS: /* stat(2) failed */
case FTS_DNR: /* unreadable directory */
@@ -1584,7 +1584,7 @@ static rpmRC processMetadataFile(Package pkg, FileList fl,
uint8_t * pkt = NULL;
ssize_t pktlen = 0;
int absolute = 0;
- int rc = RPMRC_FAIL;
+ rpmRC rc = RPMRC_FAIL;
int xx;
if (*fileName == '/') {
@@ -1647,7 +1647,7 @@ static rpmRC processBinaryFile(Package pkg, FileList fl, const char * fileName)
int quote = 1; /* XXX permit quoted glob characters. */
int doGlob;
char *diskPath = NULL;
- int rc = RPMRC_OK;
+ rpmRC rc = RPMRC_OK;
doGlob = glob_pattern_p(fileName, quote);
@@ -1680,8 +1680,7 @@ static rpmRC processBinaryFile(Package pkg, FileList fl, const char * fileName)
goto exit;
}
- rc = rpmGlob(diskPath, &argc, &argv);
- if (rc == 0 && argc >= 1) {
+ if (rpmGlob(diskPath, &argc, &argv) == 0 && argc >= 1) {
for (i = 0; i < argc; i++) {
rc = addFile(fl, argv[i], NULL);
}
@@ -1948,7 +1947,7 @@ static void genSourceRpmName(rpmSpec spec)
}
}
-int processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags)
+rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags)
{
struct Source *srcPtr;
StringBuf sourceFiles;
@@ -2075,7 +2074,7 @@ int processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags)
sourceFiles = freeStringBuf(sourceFiles);
fl.fileList = freeFileList(fl.fileList, fl.fileListRecsUsed);
freeAttrRec(&fl.def_ar);
- return fl.processingFailed;
+ return fl.processingFailed ? RPMRC_FAIL : RPMRC_OK;
}
/**
@@ -2122,11 +2121,11 @@ exit:
return rc;
}
-int processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
+rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
int installSpecialDoc, int test)
{
Package pkg;
- int rc = RPMRC_OK;
+ rpmRC rc = RPMRC_OK;
check_fileList = newStringBuf();
genSourceRpmName(spec);
diff --git a/build/pack.c b/build/pack.c
index fa4b4efa9..0b57613fe 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -658,7 +658,7 @@ static rpmRC checkPackages(char *pkgcheck)
xx = system(pkgcheck);
if (WEXITSTATUS(xx) == -1 || WEXITSTATUS(xx) == 127) {
rpmlog(RPMLOG_ERR, _("Execution of \"%s\" failed.\n"), pkgcheck);
- if (fail) return 127;
+ if (fail) return RPMRC_NOTFOUND;
}
if (WEXITSTATUS(xx) != 0) {
rpmlog(RPMLOG_ERR, _("Package check \"%s\" failed.\n"), pkgcheck);
diff --git a/build/policies.c b/build/policies.c
index 8874494dc..8cef31866 100644
--- a/build/policies.c
+++ b/build/policies.c
@@ -26,7 +26,7 @@ typedef struct ModuleRec_s {
static rpmRC writeModuleToHeader(ModuleRec mod, Package pkg)
{
- int rc = RPMRC_FAIL;
+ rpmRC rc = RPMRC_FAIL;
ARGV_t av;
uint32_t count;
struct rpmtd_s policies;
@@ -293,10 +293,10 @@ static rpmRC processPolicies(rpmSpec spec, Package pkg, int test)
return rc;
}
-int processBinaryPolicies(rpmSpec spec, int test)
+rpmRC processBinaryPolicies(rpmSpec spec, int test)
{
Package pkg;
- int rc = RPMRC_OK;
+ rpmRC rc = RPMRC_OK;
char *nvr;
#if WITH_SELINUX
diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
index 5ec8142a6..c6813816e 100644
--- a/build/rpmbuild_internal.h
+++ b/build/rpmbuild_internal.h
@@ -263,7 +263,7 @@ Package newPackage(rpmSpec spec);
* @return 0 on success
*/
RPM_GNUC_INTERNAL
-int processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
+rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
int installSpecialDoc, int test);
/** \ingroup rpmbuild
@@ -273,7 +273,7 @@ int processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
* @return 0 on success
*/
RPM_GNUC_INTERNAL
-int processBinaryPolicies(rpmSpec spec, int test);
+rpmRC processBinaryPolicies(rpmSpec spec, int test);
/** \ingroup rpmbuild
* Post-build processing for source package.
@@ -282,7 +282,7 @@ int processBinaryPolicies(rpmSpec spec, int test);
* @return 0 on success
*/
RPM_GNUC_INTERNAL
-int processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags);
+rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags);
/** \ingroup rpmbuild
* Generate binary package(s).
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 645a25fe2..319b2fd9c 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -864,7 +864,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
rpmRC rc = RPMRC_FAIL;
if (fc == NULL || argv == NULL)
- return 0; /* XXX looks very wrong */
+ return RPMRC_OK; /* XXX looks very wrong */
if (initAttrs(fc) < 1) {
rpmlog(RPMLOG_ERR, _("No file attributes configured\n"));
@@ -1088,13 +1088,13 @@ static void printDeps(Header h)
/**
*/
-static int rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi)
+static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi)
{
StringBuf sb_stdin;
StringBuf sb_stdout;
DepMsg_t dm;
int failnonzero = 0;
- int rc = RPMRC_OK;
+ rpmRC rc = RPMRC_OK;
/*
* Create file manifest buffer to deliver to dependency finder.
@@ -1166,18 +1166,18 @@ rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg)
int ac = rpmfiFC(fi);
char *buf = NULL;
int genConfigDeps;
- int rc = RPMRC_OK;
+ rpmRC rc = RPMRC_OK;
int xx;
int idx;
struct rpmtd_s td;
/* Skip packages with no files. */
if (ac <= 0)
- return 0;
+ return rc;
/* Skip packages that have dependency generation disabled. */
if (! (pkg->autoReq || pkg->autoProv))
- return 0;
+ return rc;
/* If new-fangled dependency generation is disabled ... */
if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) {