summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-06-13 14:51:21 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-06-13 14:51:21 +0000
commit854325e970561652157fd0e4d8a6cb7b1cfd53fc (patch)
tree7a98399e6f6a3e1a2f5ca14b99cc2e52f348c3b3
parent5def11696bc41dd864f5ee9e004ac52a3a52ab26 (diff)
downloadATCD-854325e970561652157fd0e4d8a6cb7b1cfd53fc.tar.gz
ChangeLogTag: Fri Jun 13 14:50:28 UTC 2008 Simon Massey <sma at prismtech dot com>
-rw-r--r--ACE/ChangeLog6
-rw-r--r--ACE/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp54
2 files changed, 33 insertions, 27 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 0ba86c9c368..812e0f2e205 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 13 14:50:28 UTC 2008 Simon Massey <sma at prismtech dot com>
+
+ Add BSD_Network_Interface_Monitor.cpp and
+
+ untab-ified to remove fuzz errors.
+
Fri Jun 13 14:45:28 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu>
* ace/Monitor_Control/Windows_Multi_Instance_Monitor.cpp:
diff --git a/ACE/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp b/ACE/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp
index 688588941cd..bef402704b1 100644
--- a/ACE/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp
+++ b/ACE/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp
@@ -31,45 +31,45 @@ namespace ACE
int fd = socket (AF_INET, SOCK_DGRAM, 0);
if (fd == -1)
{
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("socket failed\n")));
- return;
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("socket failed\n")));
+ return;
}
struct ifaddrs *ifa, *ifap;
if (getifaddrs (&ifap) < 0)
{
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("getifaddrs failed\n")));
- close (fd);
- return;
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("getifaddrs failed\n")));
+ close (fd);
+ return;
}
char *p = NULL;
for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next)
{
- if (p && strcmp (p, ifa->ifa_name) == 0)
- continue;
+ if (p && strcmp (p, ifa->ifa_name) == 0)
+ continue;
p = ifa->ifa_name;
- struct ifdatareq ifdr;
- memset (&ifdr, 0, sizeof (ifdr));
- strncpy (ifdr.ifdr_name, ifa->ifa_name, sizeof (ifdr));
-
- if (ioctl (fd, SIOCGIFDATA, &ifdr) == -1)
- {
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("SIOCGIFDATA failed\n")));
- }
-
- struct if_data * const ifi = &ifdr.ifdr_data;
-
- if (this->lookup_str_ == "ibytes") {
- count += ifi->ifi_ibytes;
- } else if (this->lookup_str_ == "ipackets") {
- count += ifi->ifi_ipackets;
- } else if (this->lookup_str_ == "obytes") {
- count += ifi->ifi_obytes;
- } else if (this->lookup_str_ == "opackets") {
- count += ifi->ifi_opackets;
- }
+ struct ifdatareq ifdr;
+ memset (&ifdr, 0, sizeof (ifdr));
+ strncpy (ifdr.ifdr_name, ifa->ifa_name, sizeof (ifdr));
+
+ if (ioctl (fd, SIOCGIFDATA, &ifdr) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("SIOCGIFDATA failed\n")));
+ }
+
+ struct if_data * const ifi = &ifdr.ifdr_data;
+
+ if (this->lookup_str_ == "ibytes") {
+ count += ifi->ifi_ibytes;
+ } else if (this->lookup_str_ == "ipackets") {
+ count += ifi->ifi_ipackets;
+ } else if (this->lookup_str_ == "obytes") {
+ count += ifi->ifi_obytes;
+ } else if (this->lookup_str_ == "opackets") {
+ count += ifi->ifi_opackets;
+ }
}
freeifaddrs (ifap);