summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-06-10 09:54:51 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-06-10 09:54:51 +0300
commitae2cd002e679c9fffb7ac8d21380e91408532339 (patch)
tree6482c45caf64c319328139861fe6c92986893e00
parent46d4daee4560da3499b4be5ce71ad6994fb279ab (diff)
downloadrpm-ae2cd002e679c9fffb7ac8d21380e91408532339.tar.gz
rpm-ae2cd002e679c9fffb7ac8d21380e91408532339.tar.bz2
rpm-ae2cd002e679c9fffb7ac8d21380e91408532339.zip
Use nlink_t for hardlink count types
- avoids some signed vs unsigned comparisons
-rw-r--r--lib/fsm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index 283d9ffee..20f4019b9 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -35,8 +35,8 @@ struct hardLink_s {
const char ** nsuffix;
int * filex;
struct stat sb;
- int nlink;
- int linksLeft;
+ nlink_t nlink;
+ nlink_t linksLeft;
int linkIndex;
int createdPath;
};
@@ -833,7 +833,7 @@ static int writeFile(FSM_t fsm, int writeData)
struct stat * st = &fsm->sb;
struct stat * ost = &fsm->osb;
char * symbuf = NULL;
- int left;
+ size_t left;
int rc;
st->st_size = (writeData ? ost->st_size : 0);
@@ -1056,7 +1056,7 @@ static int fsmCommitLinks(FSM_t fsm)
int iterIndex = fsm->ix;
struct stat * st = &fsm->sb;
int rc = 0;
- int i;
+ nlink_t i;
fsm->path = NULL;
fsm->nsuffix = NULL;
@@ -1304,7 +1304,6 @@ static int fsmStage(FSM_t fsm, fileStage stage)
int saveerrno = errno;
int rc = fsm->rc;
size_t left;
- int i;
#define _fafilter(_a) \
(!((_a) == FA_CREATE || (_a) == FA_ERASE || (_a) == FA_COPYIN || (_a) == FA_COPYOUT) \
@@ -1420,7 +1419,8 @@ static int fsmStage(FSM_t fsm, fileStage stage)
/* Flush partial sets of hard linked files. */
if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) {
- int nlink, j;
+ nlink_t i, nlink;
+ int j;
while ((fsm->li = fsm->links) != NULL) {
fsm->links = fsm->li->next;
fsm->li->next = NULL;
@@ -1886,7 +1886,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
if (fsm->goal == FSM_PKGINSTALL &&
fsm->commit && fsm->li->linksLeft)
{
- for (i = 0 ; i < fsm->li->linksLeft; i++) {
+ for (nlink_t i = 0 ; i < fsm->li->linksLeft; i++) {
if (fsm->li->filex[i] < 0)
continue;
rc = CPIOERR_MISSING_HARDLINK;