diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-19 10:48:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-19 10:48:32 +0200 |
| commit | 47cb10013e6935bb6cdf470925ea5a5f74464646 (patch) | |
| tree | bb871753b0c5f8c7a45a6f55c3977c060ead765c /plugins/check_swap.c | |
| parent | 5b29a86e3a31405f3070a82f81b171068576015e (diff) | |
| parent | efe79595d3813b81f873f125260d0f9937535134 (diff) | |
| download | monitoring-plugins-47cb10013e6935bb6cdf470925ea5a5f74464646.tar.gz | |
Merge pull request #1948 from RincewindsHat/more_booleans
Replace most of the boolean variables declared as "int" with "bool"
Diffstat (limited to 'plugins/check_swap.c')
| -rw-r--r-- | plugins/check_swap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/check_swap.c b/plugins/check_swap.c index cd965e31..fddd93fa 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c | |||
| @@ -65,7 +65,7 @@ void print_help (void); | |||
| 65 | threshold_t warn; | 65 | threshold_t warn; |
| 66 | threshold_t crit; | 66 | threshold_t crit; |
| 67 | int verbose; | 67 | int verbose; |
| 68 | int allswaps; | 68 | bool allswaps = false; |
| 69 | int no_swap_state = STATE_CRITICAL; | 69 | int no_swap_state = STATE_CRITICAL; |
| 70 | 70 | ||
| 71 | int | 71 | int |
| @@ -383,10 +383,10 @@ main (int argc, char **argv) | |||
| 383 | if (crit.is_percentage) crit_print = crit.value * (total_swap_mb *1024 *1024/100); | 383 | if (crit.is_percentage) crit_print = crit.value * (total_swap_mb *1024 *1024/100); |
| 384 | 384 | ||
| 385 | puts (perfdata_uint64 ("swap", free_swap_mb *1024 *1024, "B", | 385 | puts (perfdata_uint64 ("swap", free_swap_mb *1024 *1024, "B", |
| 386 | TRUE, warn_print, | 386 | true, warn_print, |
| 387 | TRUE, crit_print, | 387 | true, crit_print, |
| 388 | TRUE, 0, | 388 | true, 0, |
| 389 | TRUE, (long) total_swap_mb * 1024 * 1024)); | 389 | true, (long) total_swap_mb * 1024 * 1024)); |
| 390 | 390 | ||
| 391 | return result; | 391 | return result; |
| 392 | } | 392 | } |
| @@ -514,7 +514,7 @@ process_arguments (int argc, char **argv) | |||
| 514 | } | 514 | } |
| 515 | } | 515 | } |
| 516 | case 'a': /* all swap */ | 516 | case 'a': /* all swap */ |
| 517 | allswaps = TRUE; | 517 | allswaps = true; |
| 518 | break; | 518 | break; |
| 519 | case 'n': | 519 | case 'n': |
| 520 | if ((no_swap_state = mp_translate_state(optarg)) == ERROR) { | 520 | if ((no_swap_state = mp_translate_state(optarg)) == ERROR) { |
