summaryrefslogtreecommitdiff
path: root/rpmio/rpmfileutil.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2019-05-10 13:55:36 +0300
committerFlorian Festi <ffesti@redhat.com>2019-05-14 10:19:43 +0200
commit59aee7a198ea918d17f587e7fc2f8796c073c2d1 (patch)
treec7ed438483b66f043d491ab4001896ab55762a62 /rpmio/rpmfileutil.c
parent0f21bdd0d7b2c45564ddb5a24bbebd530867bd54 (diff)
downloadrpm-59aee7a198ea918d17f587e7fc2f8796c073c2d1.tar.gz
Eliminate the hysterical filesize retval from rpmDoDigest() now that we can
This is of course an API change, but we're breaking API in a bunch of other places in this cycle too so...
Diffstat (limited to 'rpmio/rpmfileutil.c')
-rw-r--r--rpmio/rpmfileutil.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c
index 4349c64a7..92aa8210b 100644
--- a/rpmio/rpmfileutil.c
+++ b/rpmio/rpmfileutil.c
@@ -21,21 +21,18 @@
static const char *rpm_config_dir = NULL;
static pthread_once_t configDirSet = PTHREAD_ONCE_INIT;
-int rpmDoDigest(int algo, const char * fn,int asAscii,
- unsigned char * digest, rpm_loff_t * fsizep)
+int rpmDoDigest(int algo, const char * fn,int asAscii, unsigned char * digest)
{
unsigned char * dig = NULL;
size_t diglen, buflen = 32 * BUFSIZ;
unsigned char *buf = xmalloc(buflen);
- rpm_loff_t fsize = 0;
int rc = 0;
FD_t fd = Fopen(fn, "r.ufdio");
if (fd) {
fdInitDigest(fd, algo, 0);
- while ((rc = Fread(buf, sizeof(*buf), buflen, fd)) > 0)
- fsize += rc;
+ while ((rc = Fread(buf, sizeof(*buf), buflen, fd)) > 0) {};
fdFiniDigest(fd, algo, (void **)&dig, &diglen, asAscii);
Fclose(fd);
}
@@ -44,8 +41,6 @@ int rpmDoDigest(int algo, const char * fn,int asAscii,
rc = 1;
} else {
memcpy(digest, dig, diglen);
- if (fsizep)
- *fsizep = fsize;
}
dig = _free(dig);