Convert flags from int to bool. Some (compress) were already used in
comparisons with bool values. No functional changes.
This commit is contained in:
parent
638000c0b6
commit
0de9332429
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user