Use true and false for assignments to bool
[collectd.git] / src / ping.c
index 8a17411..565ae99 100644 (file)
@@ -298,7 +298,7 @@ static void *ping_thread(void *arg) /* {{{ */
 
   pthread_mutex_lock(&ping_lock);
   while (ping_thread_loop > 0) {
-    _Bool send_successful = 0;
+    bool send_successful = false;
 
     if (gettimeofday(&tv_begin, NULL) < 0) {
       ERROR("ping plugin: gettimeofday failed: %s", STRERRNO);
@@ -314,7 +314,7 @@ static void *ping_thread(void *arg) /* {{{ */
                  ping_get_error(pingobj));
     } else {
       c_release(LOG_NOTICE, &complaint, "ping plugin: ping_send succeeded.");
-      send_successful = 1;
+      send_successful = true;
     }
 
     pthread_mutex_lock(&ping_lock);
@@ -476,7 +476,7 @@ static int ping_config(const char *key, const char *value) /* {{{ */
     hl->next = hostlist_head;
     hostlist_head = hl;
   } else if (strcasecmp(key, "AddressFamily") == 0) {
-    charaf = NULL;
+    char *af = NULL;
     int status = config_set_string(key, &af, value);
     if (status != 0)
       return status;
@@ -488,9 +488,7 @@ static int ping_config(const char *key, const char *value) /* {{{ */
     } else if (strncmp(af, "ipv6", 4) == 0) {
       ping_af = AF_INET6;
     } else {
-      ERROR("ping plugin: Bad address family: %s", af);
-      free(af);
-      return 1;
+      WARNING("ping plugin: Ignoring invalid AddressFamily value %s", af);
     }
     free(af);