summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-19 07:55:05 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-19 08:04:24 (GMT)
commit531e0f9427bc2d43c76102d1b1d785bfba49deb5 (patch)
tree7a7f6ad71762b4247efcf7e48e1432a7e567bf31
parenta3d76fed02d41659df707518211190418c72939e (diff)
downloadmonitoring-plugins-531e0f9427bc2d43c76102d1b1d785bfba49deb5.tar.gz
check_ntp_time: Use C99 booleans
-rw-r--r--plugins/check_ntp_time.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index 46cc604..b2e1655 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -45,7 +45,7 @@ const char *email = "devel@monitoring-plugins.org";
45static char *server_address=NULL; 45static char *server_address=NULL;
46static char *port="123"; 46static char *port="123";
47static int verbose=0; 47static int verbose=0;
48static int quiet=0; 48static bool quiet = false;
49static char *owarn="60"; 49static char *owarn="60";
50static char *ocrit="120"; 50static char *ocrit="120";
51static int time_offset=0; 51static int time_offset=0;
@@ -485,7 +485,7 @@ int process_arguments(int argc, char **argv){
485 verbose++; 485 verbose++;
486 break; 486 break;
487 case 'q': 487 case 'q':
488 quiet = 1; 488 quiet = true;
489 break; 489 break;
490 case 'w': 490 case 'w':
491 owarn = optarg; 491 owarn = optarg;
@@ -494,7 +494,7 @@ int process_arguments(int argc, char **argv){
494 ocrit = optarg; 494 ocrit = optarg;
495 break; 495 break;
496 case 'H': 496 case 'H':
497 if(is_host(optarg) == FALSE) 497 if(!is_host(optarg))
498 usage2(_("Invalid hostname/address"), optarg); 498 usage2(_("Invalid hostname/address"), optarg);
499 server_address = strdup(optarg); 499 server_address = strdup(optarg);
500 break; 500 break;
@@ -531,12 +531,11 @@ int process_arguments(int argc, char **argv){
531 return 0; 531 return 0;
532} 532}
533 533
534char *perfd_offset (double offset) 534char *perfd_offset (double offset) {
535{
536 return fperfdata ("offset", offset, "s", 535 return fperfdata ("offset", offset, "s",
537 TRUE, offset_thresholds->warning->end, 536 true, offset_thresholds->warning->end,
538 TRUE, offset_thresholds->critical->end, 537 true, offset_thresholds->critical->end,
539 FALSE, 0, FALSE, 0); 538 false, 0, false, 0);
540} 539}
541 540
542int main(int argc, char *argv[]){ 541int main(int argc, char *argv[]){
@@ -566,7 +565,7 @@ int main(int argc, char *argv[]){
566 565
567 offset = offset_request(server_address, &offset_result); 566 offset = offset_request(server_address, &offset_result);
568 if (offset_result == STATE_UNKNOWN) { 567 if (offset_result == STATE_UNKNOWN) {
569 result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL); 568 result = ( (!quiet) ? STATE_UNKNOWN : STATE_CRITICAL);
570 } else { 569 } else {
571 result = get_status(fabs(offset), offset_thresholds); 570 result = get_status(fabs(offset), offset_thresholds);
572 } 571 }