solaris-fixes branch: Applied the swap-patch by Christophe Kalt.
[collectd.git] / src / ping.c
index 6966170..91e0dbc 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/ping.c
- * Copyright (C) 2005  Florian octo Forster
+ * Copyright (C) 2005,2006  Florian octo Forster
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -61,7 +61,8 @@ static int ping_config (char *key, char *value)
        {
                if ((pingobj = ping_construct ()) == NULL)
                {
-                       syslog (LOG_ERR, "ping: `ping_construct' failed.\n");
+                       syslog (LOG_ERR, "ping: `ping_construct' failed: %s",
+                                       ping_get_error (pingobj));
                        return (1);
                }
        }
@@ -70,7 +71,8 @@ static int ping_config (char *key, char *value)
        {
                if (ping_host_add (pingobj, value) < 0)
                {
-                       syslog (LOG_WARNING, "ping: `ping_host_add' failed.");
+                       syslog (LOG_WARNING, "ping: `ping_host_add' failed: %s",
+                                       ping_get_error (pingobj));
                        return (1);
                }
        }
@@ -129,7 +131,8 @@ static void ping_read (void)
 
        if (ping_send (pingobj) < 0)
        {
-               syslog (LOG_ERR, "ping: `ping_send' failed.");
+               syslog (LOG_ERR, "ping: `ping_send' failed: %s",
+                               ping_get_error (pingobj));
                return;
        }