From: Sebastian Harl Date: Thu, 28 Jan 2010 22:29:25 +0000 (+0100) Subject: ping plugin: Improved some error messages. X-Git-Tag: collectd-4.8.4~29 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a1a04f130d16c8a0aacfeb2734af51f94734176b;p=collectd.git ping plugin: Improved some error messages. --- diff --git a/src/ping.c b/src/ping.c index de9c45bb..5187e2b7 100644 --- a/src/ping.c +++ b/src/ping.c @@ -160,7 +160,8 @@ static void *ping_thread (void *arg) /* {{{ */ int tmp_status; tmp_status = ping_host_add (pingobj, hl->host); if (tmp_status != 0) - WARNING ("ping plugin: ping_host_add (%s) failed.", hl->host); + WARNING ("ping plugin: ping_host_add (%s) failed: %s", + hl->host, ping_get_error (pingobj)); else status++; } @@ -190,7 +191,9 @@ static void *ping_thread (void *arg) /* {{{ */ if (gettimeofday (&tv_begin, NULL) < 0) { - ERROR ("ping plugin: gettimeofday failed"); + char errbuf[1024]; + ERROR ("ping plugin: gettimeofday failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); ping_thread_error = 1; break; } @@ -265,7 +268,9 @@ static void *ping_thread (void *arg) /* {{{ */ if (gettimeofday (&tv_end, NULL) < 0) { - ERROR ("ping plugin: gettimeofday failed"); + char errbuf[1024]; + ERROR ("ping plugin: gettimeofday failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); ping_thread_error = 1; break; }