diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-18 14:35:56 (GMT) |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-18 14:35:56 (GMT) |
commit | 82f391085d46d207870864c7ab6332914bdd3681 (patch) | |
tree | 8d4f16942aeba081fd0df401043972582223bc1d /plugins | |
parent | 58123356d562a29345b1145ec3cd78e7f458fb00 (diff) | |
download | monitoring-plugins-82f391085d46d207870864c7ab6332914bdd3681.tar.gz |
check_ldap: Use C99 booleans
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_ldap.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 15113b1..868ffc1 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c | |||
@@ -71,9 +71,9 @@ thresholds *entries_thresholds = NULL; | |||
71 | struct timeval tv; | 71 | struct timeval tv; |
72 | char* warn_entries = NULL; | 72 | char* warn_entries = NULL; |
73 | char* crit_entries = NULL; | 73 | char* crit_entries = NULL; |
74 | int starttls = FALSE; | 74 | bool starttls = false; |
75 | int ssl_on_connect = FALSE; | 75 | bool ssl_on_connect = false; |
76 | int verbose = 0; | 76 | bool verbose = false; |
77 | 77 | ||
78 | /* for ldap tls */ | 78 | /* for ldap tls */ |
79 | 79 | ||
@@ -115,7 +115,7 @@ main (int argc, char *argv[]) | |||
115 | usage4 (_("Could not parse arguments")); | 115 | usage4 (_("Could not parse arguments")); |
116 | 116 | ||
117 | if (strstr(argv[0],"check_ldaps") && ! starttls && ! ssl_on_connect) | 117 | if (strstr(argv[0],"check_ldaps") && ! starttls && ! ssl_on_connect) |
118 | starttls = TRUE; | 118 | starttls = true; |
119 | 119 | ||
120 | /* initialize alarm signal handling */ | 120 | /* initialize alarm signal handling */ |
121 | signal (SIGALRM, socket_timeout_alarm_handler); | 121 | signal (SIGALRM, socket_timeout_alarm_handler); |
@@ -253,11 +253,11 @@ main (int argc, char *argv[]) | |||
253 | fperfdata ("time", elapsed_time, "s", | 253 | fperfdata ("time", elapsed_time, "s", |
254 | (int)warn_time, warn_time, | 254 | (int)warn_time, warn_time, |
255 | (int)crit_time, crit_time, | 255 | (int)crit_time, crit_time, |
256 | TRUE, 0, FALSE, 0), | 256 | true, 0, false, 0), |
257 | sperfdata ("entries", (double)num_entries, "", | 257 | sperfdata ("entries", (double)num_entries, "", |
258 | warn_entries, | 258 | warn_entries, |
259 | crit_entries, | 259 | crit_entries, |
260 | TRUE, 0.0, FALSE, 0.0)); | 260 | true, 0.0, false, 0.0)); |
261 | } else { | 261 | } else { |
262 | printf (_("LDAP %s - %.3f seconds response time|%s\n"), | 262 | printf (_("LDAP %s - %.3f seconds response time|%s\n"), |
263 | state_text (status), | 263 | state_text (status), |
@@ -265,7 +265,7 @@ main (int argc, char *argv[]) | |||
265 | fperfdata ("time", elapsed_time, "s", | 265 | fperfdata ("time", elapsed_time, "s", |
266 | (int)warn_time, warn_time, | 266 | (int)warn_time, warn_time, |
267 | (int)crit_time, crit_time, | 267 | (int)crit_time, crit_time, |
268 | TRUE, 0, FALSE, 0)); | 268 | true, 0, false, 0)); |
269 | } | 269 | } |
270 | 270 | ||
271 | return status; | 271 | return status; |
@@ -313,7 +313,7 @@ process_arguments (int argc, char **argv) | |||
313 | strcpy (argv[c], "-t"); | 313 | strcpy (argv[c], "-t"); |
314 | } | 314 | } |
315 | 315 | ||
316 | while (1) { | 316 | while (true) { |
317 | c = getopt_long (argc, argv, "hvV234TS6t:c:w:H:b:p:a:D:P:C:W:", longopts, &option); | 317 | c = getopt_long (argc, argv, "hvV234TS6t:c:w:H:b:p:a:D:P:C:W:", longopts, &option); |
318 | 318 | ||
319 | if (c == -1 || c == EOF) | 319 | if (c == -1 || c == EOF) |
@@ -374,17 +374,17 @@ process_arguments (int argc, char **argv) | |||
374 | address_family = AF_INET; | 374 | address_family = AF_INET; |
375 | break; | 375 | break; |
376 | case 'v': | 376 | case 'v': |
377 | verbose++; | 377 | verbose = true; |
378 | break; | 378 | break; |
379 | case 'T': | 379 | case 'T': |
380 | if (! ssl_on_connect) | 380 | if (! ssl_on_connect) |
381 | starttls = TRUE; | 381 | starttls = true; |
382 | else | 382 | else |
383 | usage_va(_("%s cannot be combined with %s"), "-T/--starttls", "-S/--ssl"); | 383 | usage_va(_("%s cannot be combined with %s"), "-T/--starttls", "-S/--ssl"); |
384 | break; | 384 | break; |
385 | case 'S': | 385 | case 'S': |
386 | if (! starttls) { | 386 | if (! starttls) { |
387 | ssl_on_connect = TRUE; | 387 | ssl_on_connect = true; |
388 | if (ld_port == -1) | 388 | if (ld_port == -1) |
389 | ld_port = LDAPS_PORT; | 389 | ld_port = LDAPS_PORT; |
390 | } else | 390 | } else |