harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r582766 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c
Date Mon, 08 Oct 2007 10:24:57 GMT
Author: hindessm
Date: Mon Oct  8 03:24:50 2007
New Revision: 582766

URL: http://svn.apache.org/viewvc?rev=582766&view=rev
Log:
Fix code that has been "accidentally" working (because IFF_UP happens
to be 1 so "(flags & ( 1 == 1))" does what the author intended).

Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c?rev=582766&r1=582765&r2=582766&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c Mon
Oct  8 03:24:50 2007
@@ -3955,7 +3955,7 @@
         {
           /* only return the interfaces that are up so check the IFF_UP flag) */
           returnedInfoHeader = NLMSG_DATA (currentNlHeader);
-          if (returnedInfoHeader->ifi_flags & IFF_UP == IFF_UP)
+          if ((returnedInfoHeader->ifi_flags & IFF_UP) == IFF_UP)
             {
               numAdapters++;
             }
@@ -4031,7 +4031,7 @@
           returnedInfoHeader = NLMSG_DATA (currentNlHeader);
 
           /* only return adapters that are up */
-          if (returnedInfoHeader->ifi_flags & IFF_UP == IFF_UP)
+          if ((returnedInfoHeader->ifi_flags & IFF_UP) == IFF_UP)
             {
               interfaces[currentAdapterIndex].index =
                 returnedInfoHeader->ifi_index;
@@ -4375,7 +4375,7 @@
           /* make sure the interface is up */
           reqCopy = *currentIfReq;
           ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
-          if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+          if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
             {
               numAdapters++;
             }
@@ -4416,7 +4416,7 @@
       /* make sure the interface is still up */
       reqCopy = *currentIfReq;
       ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
-      if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+      if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
         {
           /* since this function can return multiple entries for the same name, only do it
for the first one with any given name */
           if ((NULL == lastName)
@@ -4636,7 +4636,7 @@
           /* make sure the interface is up */
           reqCopy = ifc.ifc_req[counter];
           ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
-          if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+          if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
             {
               numAdapters++;
             }
@@ -4672,7 +4672,7 @@
       /* make sure the interface is still up */
       reqCopy = ifc.ifc_req[counter];
       ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
-      if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+      if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
         {
           /* since this function can return multiple entries for the same name, only do it
for the first one with any given name */
           if ((NULL == lastName)



Mime
View raw message