All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: SE Linux <selinux@tycho.nsa.gov>
Subject: setfiles will only put out a "*" if > 1000 files are fixed.
Date: Wed, 20 May 2009 13:08:14 -0400	[thread overview]
Message-ID: <4A1438FE.2000207@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 129 bytes --]

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

[-- Attachment #2: policycoreutils-setfiles.patch --]
[-- Type: text/plain, Size: 815 bytes --]

--- nsapolicycoreutils/setfiles/setfiles.c	2008-08-28 09:34:24.000000000 -0400
+++ policycoreutils-2.0.62/setfiles/setfiles.c	2009-05-14 11:05:15.000000000 -0400
@@ -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 @@
 
 	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 @@
 		free(excludeArray[i].directory);
 	}
 
-       if (progress)
+       if (progress && count >= STAR_COUNT)
                printf("\n");
 	exit(errors);
 }

             reply	other threads:[~2009-05-20 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 17:08 Daniel J Walsh [this message]
2009-06-23 17:07 ` setfiles will only put out a "*" if > 1000 files are fixed Joshua Brindle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A1438FE.2000207@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.