Author: Daniel J Walsh

Email: dwalsh@redhat.com
Subject: setfiles will only put out a "*" if > 1000 files are fixed.
Date: Wed, 20 May 2009 13:08:14 -0400

setfiles was always putting out a \n, even when not many files were
being fixed. yum transactions were being desturbed by this.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
This commit is contained in:
Daniel J Walsh 2009-06-19 13:16:24 -04:00 committed by Joshua Brindle
parent 323a16ff37
commit 275d7f658e

View File

@ -29,6 +29,8 @@
static int mass_relabel;
static int mass_relabel_errs;
#define STAR_COUNT 1000
static FILE *outfile = NULL;
static int force = 0;
#define STAT_BLOCK_SIZE 1
@ -444,11 +446,11 @@ static int restore(const char *file)
if (progress) {
count++;
if (count % 80000 == 0) {
if (count % (80 * STAR_COUNT) == 0) {
fprintf(stdout, "\n");
fflush(stdout);
}
if (count % 1000 == 0) {
if (count % STAR_COUNT == 0) {
fprintf(stdout, "*");
fflush(stdout);
}
@ -1017,7 +1019,7 @@ int main(int argc, char **argv)
free(excludeArray[i].directory);
}
if (progress)
if (progress && count >= STAR_COUNT)
printf("\n");
exit(errors);
}