diff options
author | glebius <glebius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f> | 2020-10-29 23:15:11 +0000 |
---|---|---|
committer | glebius <glebius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f> | 2020-10-29 23:15:11 +0000 |
commit | e5e7e48f68c383cb1d60c2af2fcd1ace7a161c81 (patch) | |
tree | 2ae4e7b7e9f47bbe5c70d97bfb0d154c22c4d3db | |
parent | 6827902a8b49cc028af7ada3c07bef9196873c76 (diff) | |
download | freebsd-e5e7e48f68c383cb1d60c2af2fcd1ace7a161c81.tar.gz freebsd-e5e7e48f68c383cb1d60c2af2fcd1ace7a161c81.tar.bz2 |
Convert flags from int to bool. Some (compress) were already used in
comparisons with bool values. No functional changes.
git-svn-id: http://svn.freebsd.org/base/head@367150 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
-rw-r--r-- | sbin/savecore/savecore.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 47d05627f18..abfccf74010 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -102,7 +102,8 @@ __FBSDID("$FreeBSD$"); static cap_channel_t *capsyslog; static fileargs_t *capfa; -static int checkfor, compress, clear, force, keep, verbose; /* flags */ +static bool checkfor, compress, clear, force, keep; /* flags */ +static int verbose; static int nfound, nsaved, nerr; /* statistics */ static int maxdumps; @@ -676,7 +677,7 @@ DoFile(const char *savedir, int savedirfd, const char *device) dtoh32(kdhl.version), device); status = STATUS_BAD; - if (force == 0) + if (force == false) goto closefd; } } else if (compare_magic(&kdhl, KERNELDUMPMAGIC)) { @@ -686,7 +687,7 @@ DoFile(const char *savedir, int savedirfd, const char *device) dtoh32(kdhl.version), device); status = STATUS_BAD; - if (force == 0) + if (force == false) goto closefd; } switch (kdhl.compression) { @@ -710,7 +711,7 @@ DoFile(const char *savedir, int savedirfd, const char *device) device); status = STATUS_BAD; - if (force == 0) + if (force == false) goto closefd; if (compare_magic(&kdhl, KERNELDUMPMAGIC_CLEARED)) { @@ -727,7 +728,7 @@ DoFile(const char *savedir, int savedirfd, const char *device) dtoh32(kdhl.version), device); status = STATUS_BAD; - if (force == 0) + if (force == false) goto closefd; } } @@ -741,7 +742,7 @@ DoFile(const char *savedir, int savedirfd, const char *device) "parity error on last dump header on %s", device); nerr++; status = STATUS_BAD; - if (force == 0) + if (force == false) goto closefd; } dumpextent = dtoh64(kdhl.dumpextent); @@ -772,7 +773,7 @@ DoFile(const char *savedir, int savedirfd, const char *device) "first and last dump headers disagree on %s", device); nerr++; status = STATUS_BAD; - if (force == 0) + if (force == false) goto closefd; } else { status = STATUS_GOOD; @@ -1110,7 +1111,8 @@ main(int argc, char **argv) char **devs; int i, ch, error, savedirfd; - checkfor = compress = clear = force = keep = verbose = 0; + checkfor = compress = clear = force = keep = false; + verbose = 0; nfound = nsaved = nerr = 0; savedir = "."; @@ -1124,16 +1126,16 @@ main(int argc, char **argv) while ((ch = getopt(argc, argv, "Ccfkm:vz")) != -1) switch(ch) { case 'C': - checkfor = 1; + checkfor = true; break; case 'c': - clear = 1; + clear = true; break; case 'f': - force = 1; + force = true; break; case 'k': - keep = 1; + keep = true; break; case 'm': maxdumps = atoi(optarg); |