-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5WrI8ACgkQrlYvE4MpobO61QCfS32IS4asXgAwGkkPfN6aYJHQ MS4AoKvwCn217fihlCBZHZxO2RfvS8k5 =/3yD -----END PGP SIGNATURE-----
>From 11394da2021feefa57355d4d2384244028d71b1a Mon Sep 17 00:00:00 2001 From: Eric Paris <eparis@xxxxxxxxxx> Date: Sun, 10 Jul 2011 17:32:14 +0200 Subject: [PATCH 24/77] policycoreutils: setfiles: get rid of some stupid globals We have some useless globals in setfiles that don't need to be. Stop it. Signed-off-by: Eric Paris <eparis@xxxxxxxxxx> --- policycoreutils/setfiles/setfiles.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/policycoreutils/setfiles/setfiles.c b/policycoreutils/setfiles/setfiles.c index e4f87bc..fa0cd6a 100644 --- a/policycoreutils/setfiles/setfiles.c +++ b/policycoreutils/setfiles/setfiles.c @@ -14,8 +14,6 @@ #define AUDIT_FS_RELABEL 2309 #endif #endif -static int mass_relabel; -static int mass_relabel_errs; /* cmdline opts*/ @@ -23,7 +21,6 @@ static int mass_relabel_errs; static char *policyfile = NULL; static int warn_no_match = 0; static int null_terminated = 0; -static int errors; static struct restore_opts r_opts; #define STAT_BLOCK_SIZE 1 @@ -107,10 +104,11 @@ int canoncon(char **contextp) } #ifndef USE_AUDIT -static void maybe_audit_mass_relabel(void) +static void maybe_audit_mass_relabel(int mass_relabel __attribute__((unused)), + int mass_relabel_errs __attribute__((unused))) { #else -static void maybe_audit_mass_relabel(void) +static void maybe_audit_mass_relabel(int mass_relabel, int mass_relabel_errs) { int audit_fd = -1; int rc = 0; @@ -146,6 +144,7 @@ int main(int argc, char **argv) size_t buf_len; int recurse; /* Recursive descent. */ char *base; + int mass_relabel = 0, errors = 0; memset(&r_opts, 0, sizeof(r_opts)); @@ -423,9 +422,7 @@ int main(int argc, char **argv) } } - if (mass_relabel) - mass_relabel_errs = errors; - maybe_audit_mass_relabel(); + maybe_audit_mass_relabel(mass_relabel, errors); if (warn_no_match) selabel_stats(r_opts.hnd); -- 1.7.6