summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0ae668b)
raw | patch | inline | side by side (parent: 0ae668b)
author | Florian Forster <octo@huhu.verplant.org> | |
Thu, 1 Nov 2007 09:06:52 +0000 (10:06 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Thu, 1 Nov 2007 09:06:52 +0000 (10:06 +0100) |
This should remove an error message on non-IPv6-enabled hosts..
src/tcpconns.c | patch | blob | history |
diff --git a/src/tcpconns.c b/src/tcpconns.c
index 74874ae36382080ebd90af4dcfdb0079965e3d10..00cad0e46fa8b4e7857a3c929882a8a6409dacae 100644 (file)
--- a/src/tcpconns.c
+++ b/src/tcpconns.c
fh = fopen (file, "r");
if (fh == NULL)
- {
- char errbuf[1024];
- ERROR ("tcpconns plugin: fopen (%s) failed: %s",
- file, sstrerror (errno, errbuf, sizeof (errbuf)));
return (-1);
- }
while (fgets (buffer, sizeof (buffer), fh) != NULL)
{
static int conn_read (void)
{
+ int errors_num = 0;
+
conn_reset_port_entry ();
- conn_read_file ("/proc/net/tcp");
- conn_read_file ("/proc/net/tcp6");
+ if (conn_read_file ("/proc/net/tcp") != 0)
+ errors_num++;
+ if (conn_read_file ("/proc/net/tcp6") != 0)
+ errors_num++;
- conn_submit_all ();
+ if (errors_num < 2)
+ {
+ conn_submit_all ();
+ }
+ else
+ {
+ ERROR ("tcpconns plugin: Neither /proc/net/tcp nor /proc/net/tcp6 "
+ "coult be read.");
+ return (-1);
+ }
return (0);
} /* int conn_read */