Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 2014 17:24:29 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
Subject:   [SVN-Commit] r1499 - in trunk: mail/thunderbird/files www/firefox-esr/files www/firefox-nightly/files www/firefox/files www/libxul/files www/seamonkey/files
Message-ID:  <201402151724.s1FHOTwP067037@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sat Feb 15 17:24:29 2014
New Revision: 1499

Log:
improve style for the next round of review

Modified:
   trunk/mail/thunderbird/files/patch-bug893397
   trunk/www/firefox-esr/files/patch-bug893397
   trunk/www/firefox-nightly/files/patch-bug893397
   trunk/www/firefox/files/patch-bug893397
   trunk/www/libxul/files/patch-bug893397
   trunk/www/seamonkey/files/patch-bug893397

Modified: trunk/mail/thunderbird/files/patch-bug893397
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug893397	Sat Feb 15 05:09:19 2014	(r1498)
+++ trunk/mail/thunderbird/files/patch-bug893397	Sat Feb 15 17:24:29 2014	(r1499)
@@ -2,7 +2,7 @@
 index 549ad06..2878d9f 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in
        NECKO_WIFI=1
      fi
      ;;
@@ -15,9 +15,9 @@
 index 07b01de..11706af 100644
 --- mozilla/netwerk/wifi/moz.build
 +++ mozilla/netwerk/wifi/moz.build
-@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
-     CMMSRCS += [
-         'osx_corewlan.mm',
+@@ -31,6 +31,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+     CPP_SOURCES += [
+         'nsWifiScannerMac.cpp',
      ]
 +elif CONFIG['OS_ARCH'] == 'FreeBSD':
 +    CPP_SOURCES += [
@@ -31,7 +31,7 @@
 index 0000000..80d4cb6
 --- /dev/null
 +++ mozilla/netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,168 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -60,25 +60,19 @@
 +static nsresult
 +FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
 +{
-+  bool res = false;
-+  char *dupn = NULL;
-+  struct ifaddrs *ifal, *ifa;
-+  unsigned len;
-+
 +  // get list of interfaces
++  struct ifaddrs *ifal;
 +  if (getifaddrs(&ifal) < 0)
 +    return NS_ERROR_FAILURE;
 +
 +  accessPoints.Clear();
 +
 +  // loop through the interfaces
++  nsresult rv = NS_ERROR_FAILURE;
++  struct ifaddrs *ifa;
++  char *dupn = NULL;
 +  for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
-+    int s;
 +    struct ifreq ifr;
-+    struct ifmediareq ifmr;
-+    struct ieee80211req i802r;
-+    char iscanbuf[32*1024], *vsr;
-+
 +    memset(&ifr, 0, sizeof(ifr));
 +
 +    // list can contain duplicates, so ignore those
@@ -91,10 +85,12 @@
 +    ifr.ifr_addr.sa_family = AF_LOCAL;
 +
 +    // open socket to interface
-+    if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++    int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
++    if (s < 0)
 +      continue;
 +
 +    // clear interface media structure
++    struct ifmediareq ifmr;
 +    (void) memset(&ifmr, 0, sizeof(ifmr));
 +    (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
 +
@@ -111,6 +107,8 @@
 +    }
 +
 +    // perform WiFi scan
++    struct ieee80211req i802r;
++    char iscanbuf[32*1024];
 +    (void) memset(&i802r, 0, sizeof(i802r));
 +    (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
 +    i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
@@ -125,18 +123,15 @@
 +    close(s);
 +
 +    // loop through WiFi networks and build geoloc-lookup structure
-+    vsr = (char *) i802r.i_data;
-+    len = i802r.i_len;
++    char *vsr = (char *) i802r.i_data;
++    unsigned len = i802r.i_len;
 +    while (len >= sizeof(struct ieee80211req_scan_result)) {
-+      struct ieee80211req_scan_result *isr;
-+      char *id;
-+      int idlen;
-+      char ssid[IEEE80211_NWID_LEN+1];
-+      nsWifiAccessPoint *ap;
-+
-+      isr = (struct ieee80211req_scan_result *) vsr;
++      struct ieee80211req_scan_result *isr =
++        (struct ieee80211req_scan_result *) vsr;
 +
 +      // determine size of this entry
++      char *id;
++      int idlen;
 +      if (isr->isr_meshid_len) {
 +        id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
 +        idlen = isr->isr_meshid_len;
@@ -147,14 +142,15 @@
 +      }
 +
 +      // copy network data
++      char ssid[IEEE80211_NWID_LEN+1];
 +      strncpy(ssid, id, idlen);
 +      ssid[idlen] = '\0';
-+      ap = new nsWifiAccessPoint();
++      nsWifiAccessPoint *ap = new nsWifiAccessPoint();
 +      ap->setSSID(ssid, strlen(ssid));
 +      ap->setMac(isr->isr_bssid);
 +      ap->setSignal(isr->isr_rssi);
 +      accessPoints.AppendObject(ap);
-+      res = true;
++      rv = NS_OK;
 +
 +      // log the data
 +      LOG(( "FreeBSD access point: "
@@ -172,7 +168,7 @@
 +
 +  freeifaddrs(ifal);
 +
-+  return res ? NS_OK : NS_ERROR_FAILURE;
++  return rv;
 +}
 +
 +nsresult

Modified: trunk/www/firefox-esr/files/patch-bug893397
==============================================================================
--- trunk/www/firefox-esr/files/patch-bug893397	Sat Feb 15 05:09:19 2014	(r1498)
+++ trunk/www/firefox-esr/files/patch-bug893397	Sat Feb 15 17:24:29 2014	(r1499)
@@ -2,7 +2,7 @@
 index 549ad06..2878d9f 100644
 --- configure.in
 +++ configure.in
-@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in
        NECKO_WIFI=1
      fi
      ;;
@@ -15,9 +15,9 @@
 index 07b01de..11706af 100644
 --- netwerk/wifi/moz.build
 +++ netwerk/wifi/moz.build
-@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
-     CMMSRCS += [
-         'osx_corewlan.mm',
+@@ -31,6 +31,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+     CPP_SOURCES += [
+         'nsWifiScannerMac.cpp',
      ]
 +elif CONFIG['OS_ARCH'] == 'FreeBSD':
 +    CPP_SOURCES += [
@@ -31,7 +31,7 @@
 index 0000000..80d4cb6
 --- /dev/null
 +++ netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,168 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -60,25 +60,19 @@
 +static nsresult
 +FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
 +{
-+  bool res = false;
-+  char *dupn = NULL;
-+  struct ifaddrs *ifal, *ifa;
-+  unsigned len;
-+
 +  // get list of interfaces
++  struct ifaddrs *ifal;
 +  if (getifaddrs(&ifal) < 0)
 +    return NS_ERROR_FAILURE;
 +
 +  accessPoints.Clear();
 +
 +  // loop through the interfaces
++  nsresult rv = NS_ERROR_FAILURE;
++  struct ifaddrs *ifa;
++  char *dupn = NULL;
 +  for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
-+    int s;
 +    struct ifreq ifr;
-+    struct ifmediareq ifmr;
-+    struct ieee80211req i802r;
-+    char iscanbuf[32*1024], *vsr;
-+
 +    memset(&ifr, 0, sizeof(ifr));
 +
 +    // list can contain duplicates, so ignore those
@@ -91,10 +85,12 @@
 +    ifr.ifr_addr.sa_family = AF_LOCAL;
 +
 +    // open socket to interface
-+    if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++    int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
++    if (s < 0)
 +      continue;
 +
 +    // clear interface media structure
++    struct ifmediareq ifmr;
 +    (void) memset(&ifmr, 0, sizeof(ifmr));
 +    (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
 +
@@ -111,6 +107,8 @@
 +    }
 +
 +    // perform WiFi scan
++    struct ieee80211req i802r;
++    char iscanbuf[32*1024];
 +    (void) memset(&i802r, 0, sizeof(i802r));
 +    (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
 +    i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
@@ -125,18 +123,15 @@
 +    close(s);
 +
 +    // loop through WiFi networks and build geoloc-lookup structure
-+    vsr = (char *) i802r.i_data;
-+    len = i802r.i_len;
++    char *vsr = (char *) i802r.i_data;
++    unsigned len = i802r.i_len;
 +    while (len >= sizeof(struct ieee80211req_scan_result)) {
-+      struct ieee80211req_scan_result *isr;
-+      char *id;
-+      int idlen;
-+      char ssid[IEEE80211_NWID_LEN+1];
-+      nsWifiAccessPoint *ap;
-+
-+      isr = (struct ieee80211req_scan_result *) vsr;
++      struct ieee80211req_scan_result *isr =
++        (struct ieee80211req_scan_result *) vsr;
 +
 +      // determine size of this entry
++      char *id;
++      int idlen;
 +      if (isr->isr_meshid_len) {
 +        id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
 +        idlen = isr->isr_meshid_len;
@@ -147,14 +142,15 @@
 +      }
 +
 +      // copy network data
++      char ssid[IEEE80211_NWID_LEN+1];
 +      strncpy(ssid, id, idlen);
 +      ssid[idlen] = '\0';
-+      ap = new nsWifiAccessPoint();
++      nsWifiAccessPoint *ap = new nsWifiAccessPoint();
 +      ap->setSSID(ssid, strlen(ssid));
 +      ap->setMac(isr->isr_bssid);
 +      ap->setSignal(isr->isr_rssi);
 +      accessPoints.AppendObject(ap);
-+      res = true;
++      rv = NS_OK;
 +
 +      // log the data
 +      LOG(( "FreeBSD access point: "
@@ -172,7 +168,7 @@
 +
 +  freeifaddrs(ifal);
 +
-+  return res ? NS_OK : NS_ERROR_FAILURE;
++  return rv;
 +}
 +
 +nsresult

Modified: trunk/www/firefox-nightly/files/patch-bug893397
==============================================================================
--- trunk/www/firefox-nightly/files/patch-bug893397	Sat Feb 15 05:09:19 2014	(r1498)
+++ trunk/www/firefox-nightly/files/patch-bug893397	Sat Feb 15 17:24:29 2014	(r1499)
@@ -2,7 +2,7 @@
 index 549ad06..2878d9f 100644
 --- configure.in
 +++ configure.in
-@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in
        NECKO_WIFI=1
      fi
      ;;
@@ -15,23 +15,23 @@
 index 07b01de..11706af 100644
 --- netwerk/wifi/moz.build
 +++ netwerk/wifi/moz.build
-@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
-     CMMSRCS += [
+@@ -35,6 +35,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+     UNIFIED_SOURCES += [
          'osx_corewlan.mm',
      ]
 +elif CONFIG['OS_ARCH'] == 'FreeBSD':
-+    SOURCES += [
++    UNIFIED_SOURCES += [
 +        'nsWifiScannerFreeBSD.cpp',
 +    ]
  elif CONFIG['OS_ARCH'] == 'WINNT':
-     CPP_SOURCES += [
+     UNIFIED_SOURCES += [
          'nsWifiScannerWin.cpp',
 diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp
 new file mode 100644
 index 0000000..80d4cb6
 --- /dev/null
 +++ netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,168 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -60,25 +60,19 @@
 +static nsresult
 +FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
 +{
-+  bool res = false;
-+  char *dupn = NULL;
-+  struct ifaddrs *ifal, *ifa;
-+  unsigned len;
-+
 +  // get list of interfaces
++  struct ifaddrs *ifal;
 +  if (getifaddrs(&ifal) < 0)
 +    return NS_ERROR_FAILURE;
 +
 +  accessPoints.Clear();
 +
 +  // loop through the interfaces
++  nsresult rv = NS_ERROR_FAILURE;
++  struct ifaddrs *ifa;
++  char *dupn = NULL;
 +  for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
-+    int s;
 +    struct ifreq ifr;
-+    struct ifmediareq ifmr;
-+    struct ieee80211req i802r;
-+    char iscanbuf[32*1024], *vsr;
-+
 +    memset(&ifr, 0, sizeof(ifr));
 +
 +    // list can contain duplicates, so ignore those
@@ -91,10 +85,12 @@
 +    ifr.ifr_addr.sa_family = AF_LOCAL;
 +
 +    // open socket to interface
-+    if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++    int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
++    if (s < 0)
 +      continue;
 +
 +    // clear interface media structure
++    struct ifmediareq ifmr;
 +    (void) memset(&ifmr, 0, sizeof(ifmr));
 +    (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
 +
@@ -111,6 +107,8 @@
 +    }
 +
 +    // perform WiFi scan
++    struct ieee80211req i802r;
++    char iscanbuf[32*1024];
 +    (void) memset(&i802r, 0, sizeof(i802r));
 +    (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
 +    i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
@@ -125,18 +123,15 @@
 +    close(s);
 +
 +    // loop through WiFi networks and build geoloc-lookup structure
-+    vsr = (char *) i802r.i_data;
-+    len = i802r.i_len;
++    char *vsr = (char *) i802r.i_data;
++    unsigned len = i802r.i_len;
 +    while (len >= sizeof(struct ieee80211req_scan_result)) {
-+      struct ieee80211req_scan_result *isr;
-+      char *id;
-+      int idlen;
-+      char ssid[IEEE80211_NWID_LEN+1];
-+      nsWifiAccessPoint *ap;
-+
-+      isr = (struct ieee80211req_scan_result *) vsr;
++      struct ieee80211req_scan_result *isr =
++        (struct ieee80211req_scan_result *) vsr;
 +
 +      // determine size of this entry
++      char *id;
++      int idlen;
 +      if (isr->isr_meshid_len) {
 +        id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
 +        idlen = isr->isr_meshid_len;
@@ -147,14 +142,15 @@
 +      }
 +
 +      // copy network data
++      char ssid[IEEE80211_NWID_LEN+1];
 +      strncpy(ssid, id, idlen);
 +      ssid[idlen] = '\0';
-+      ap = new nsWifiAccessPoint();
++      nsWifiAccessPoint *ap = new nsWifiAccessPoint();
 +      ap->setSSID(ssid, strlen(ssid));
 +      ap->setMac(isr->isr_bssid);
 +      ap->setSignal(isr->isr_rssi);
 +      accessPoints.AppendObject(ap);
-+      res = true;
++      rv = NS_OK;
 +
 +      // log the data
 +      LOG(( "FreeBSD access point: "
@@ -172,7 +168,7 @@
 +
 +  freeifaddrs(ifal);
 +
-+  return res ? NS_OK : NS_ERROR_FAILURE;
++  return rv;
 +}
 +
 +nsresult

Modified: trunk/www/firefox/files/patch-bug893397
==============================================================================
--- trunk/www/firefox/files/patch-bug893397	Sat Feb 15 05:09:19 2014	(r1498)
+++ trunk/www/firefox/files/patch-bug893397	Sat Feb 15 17:24:29 2014	(r1499)
@@ -2,7 +2,7 @@
 index 549ad06..2878d9f 100644
 --- configure.in
 +++ configure.in
-@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in
        NECKO_WIFI=1
      fi
      ;;
@@ -15,23 +15,23 @@
 index 07b01de..11706af 100644
 --- netwerk/wifi/moz.build
 +++ netwerk/wifi/moz.build
-@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
-     CMMSRCS += [
+@@ -35,6 +35,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+     UNIFIED_SOURCES += [
          'osx_corewlan.mm',
      ]
 +elif CONFIG['OS_ARCH'] == 'FreeBSD':
-+    SOURCES += [
++    UNIFIED_SOURCES += [
 +        'nsWifiScannerFreeBSD.cpp',
 +    ]
  elif CONFIG['OS_ARCH'] == 'WINNT':
-     CPP_SOURCES += [
+     UNIFIED_SOURCES += [
          'nsWifiScannerWin.cpp',
 diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp
 new file mode 100644
 index 0000000..80d4cb6
 --- /dev/null
 +++ netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,168 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -60,25 +60,19 @@
 +static nsresult
 +FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
 +{
-+  bool res = false;
-+  char *dupn = NULL;
-+  struct ifaddrs *ifal, *ifa;
-+  unsigned len;
-+
 +  // get list of interfaces
++  struct ifaddrs *ifal;
 +  if (getifaddrs(&ifal) < 0)
 +    return NS_ERROR_FAILURE;
 +
 +  accessPoints.Clear();
 +
 +  // loop through the interfaces
++  nsresult rv = NS_ERROR_FAILURE;
++  struct ifaddrs *ifa;
++  char *dupn = NULL;
 +  for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
-+    int s;
 +    struct ifreq ifr;
-+    struct ifmediareq ifmr;
-+    struct ieee80211req i802r;
-+    char iscanbuf[32*1024], *vsr;
-+
 +    memset(&ifr, 0, sizeof(ifr));
 +
 +    // list can contain duplicates, so ignore those
@@ -91,10 +85,12 @@
 +    ifr.ifr_addr.sa_family = AF_LOCAL;
 +
 +    // open socket to interface
-+    if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++    int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
++    if (s < 0)
 +      continue;
 +
 +    // clear interface media structure
++    struct ifmediareq ifmr;
 +    (void) memset(&ifmr, 0, sizeof(ifmr));
 +    (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
 +
@@ -111,6 +107,8 @@
 +    }
 +
 +    // perform WiFi scan
++    struct ieee80211req i802r;
++    char iscanbuf[32*1024];
 +    (void) memset(&i802r, 0, sizeof(i802r));
 +    (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
 +    i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
@@ -125,18 +123,15 @@
 +    close(s);
 +
 +    // loop through WiFi networks and build geoloc-lookup structure
-+    vsr = (char *) i802r.i_data;
-+    len = i802r.i_len;
++    char *vsr = (char *) i802r.i_data;
++    unsigned len = i802r.i_len;
 +    while (len >= sizeof(struct ieee80211req_scan_result)) {
-+      struct ieee80211req_scan_result *isr;
-+      char *id;
-+      int idlen;
-+      char ssid[IEEE80211_NWID_LEN+1];
-+      nsWifiAccessPoint *ap;
-+
-+      isr = (struct ieee80211req_scan_result *) vsr;
++      struct ieee80211req_scan_result *isr =
++        (struct ieee80211req_scan_result *) vsr;
 +
 +      // determine size of this entry
++      char *id;
++      int idlen;
 +      if (isr->isr_meshid_len) {
 +        id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
 +        idlen = isr->isr_meshid_len;
@@ -147,14 +142,15 @@
 +      }
 +
 +      // copy network data
++      char ssid[IEEE80211_NWID_LEN+1];
 +      strncpy(ssid, id, idlen);
 +      ssid[idlen] = '\0';
-+      ap = new nsWifiAccessPoint();
++      nsWifiAccessPoint *ap = new nsWifiAccessPoint();
 +      ap->setSSID(ssid, strlen(ssid));
 +      ap->setMac(isr->isr_bssid);
 +      ap->setSignal(isr->isr_rssi);
 +      accessPoints.AppendObject(ap);
-+      res = true;
++      rv = NS_OK;
 +
 +      // log the data
 +      LOG(( "FreeBSD access point: "
@@ -172,7 +168,7 @@
 +
 +  freeifaddrs(ifal);
 +
-+  return res ? NS_OK : NS_ERROR_FAILURE;
++  return rv;
 +}
 +
 +nsresult

Modified: trunk/www/libxul/files/patch-bug893397
==============================================================================
--- trunk/www/libxul/files/patch-bug893397	Sat Feb 15 05:09:19 2014	(r1498)
+++ trunk/www/libxul/files/patch-bug893397	Sat Feb 15 17:24:29 2014	(r1499)
@@ -2,7 +2,7 @@
 index 549ad06..2878d9f 100644
 --- configure.in
 +++ configure.in
-@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in
        NECKO_WIFI=1
      fi
      ;;
@@ -15,9 +15,9 @@
 index 07b01de..11706af 100644
 --- netwerk/wifi/moz.build
 +++ netwerk/wifi/moz.build
-@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
-     CMMSRCS += [
-         'osx_corewlan.mm',
+@@ -31,6 +31,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+     CPP_SOURCES += [
+         'nsWifiScannerMac.cpp',
      ]
 +elif CONFIG['OS_ARCH'] == 'FreeBSD':
 +    CPP_SOURCES += [
@@ -31,7 +31,7 @@
 index 0000000..80d4cb6
 --- /dev/null
 +++ netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,168 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -60,25 +60,19 @@
 +static nsresult
 +FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
 +{
-+  bool res = false;
-+  char *dupn = NULL;
-+  struct ifaddrs *ifal, *ifa;
-+  unsigned len;
-+
 +  // get list of interfaces
++  struct ifaddrs *ifal;
 +  if (getifaddrs(&ifal) < 0)
 +    return NS_ERROR_FAILURE;
 +
 +  accessPoints.Clear();
 +
 +  // loop through the interfaces
++  nsresult rv = NS_ERROR_FAILURE;
++  struct ifaddrs *ifa;
++  char *dupn = NULL;
 +  for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
-+    int s;
 +    struct ifreq ifr;
-+    struct ifmediareq ifmr;
-+    struct ieee80211req i802r;
-+    char iscanbuf[32*1024], *vsr;
-+
 +    memset(&ifr, 0, sizeof(ifr));
 +
 +    // list can contain duplicates, so ignore those
@@ -91,10 +85,12 @@
 +    ifr.ifr_addr.sa_family = AF_LOCAL;
 +
 +    // open socket to interface
-+    if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++    int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
++    if (s < 0)
 +      continue;
 +
 +    // clear interface media structure
++    struct ifmediareq ifmr;
 +    (void) memset(&ifmr, 0, sizeof(ifmr));
 +    (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
 +
@@ -111,6 +107,8 @@
 +    }
 +
 +    // perform WiFi scan
++    struct ieee80211req i802r;
++    char iscanbuf[32*1024];
 +    (void) memset(&i802r, 0, sizeof(i802r));
 +    (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
 +    i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
@@ -125,18 +123,15 @@
 +    close(s);
 +
 +    // loop through WiFi networks and build geoloc-lookup structure
-+    vsr = (char *) i802r.i_data;
-+    len = i802r.i_len;
++    char *vsr = (char *) i802r.i_data;
++    unsigned len = i802r.i_len;
 +    while (len >= sizeof(struct ieee80211req_scan_result)) {
-+      struct ieee80211req_scan_result *isr;
-+      char *id;
-+      int idlen;
-+      char ssid[IEEE80211_NWID_LEN+1];
-+      nsWifiAccessPoint *ap;
-+
-+      isr = (struct ieee80211req_scan_result *) vsr;
++      struct ieee80211req_scan_result *isr =
++        (struct ieee80211req_scan_result *) vsr;
 +
 +      // determine size of this entry
++      char *id;
++      int idlen;
 +      if (isr->isr_meshid_len) {
 +        id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
 +        idlen = isr->isr_meshid_len;
@@ -147,14 +142,15 @@
 +      }
 +
 +      // copy network data
++      char ssid[IEEE80211_NWID_LEN+1];
 +      strncpy(ssid, id, idlen);
 +      ssid[idlen] = '\0';
-+      ap = new nsWifiAccessPoint();
++      nsWifiAccessPoint *ap = new nsWifiAccessPoint();
 +      ap->setSSID(ssid, strlen(ssid));
 +      ap->setMac(isr->isr_bssid);
 +      ap->setSignal(isr->isr_rssi);
 +      accessPoints.AppendObject(ap);
-+      res = true;
++      rv = NS_OK;
 +
 +      // log the data
 +      LOG(( "FreeBSD access point: "
@@ -172,7 +168,7 @@
 +
 +  freeifaddrs(ifal);
 +
-+  return res ? NS_OK : NS_ERROR_FAILURE;
++  return rv;
 +}
 +
 +nsresult

Modified: trunk/www/seamonkey/files/patch-bug893397
==============================================================================
--- trunk/www/seamonkey/files/patch-bug893397	Sat Feb 15 05:09:19 2014	(r1498)
+++ trunk/www/seamonkey/files/patch-bug893397	Sat Feb 15 17:24:29 2014	(r1499)
@@ -2,7 +2,7 @@
 index 549ad06..2878d9f 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in
        NECKO_WIFI=1
      fi
      ;;
@@ -15,23 +15,23 @@
 index 07b01de..11706af 100644
 --- mozilla/netwerk/wifi/moz.build
 +++ mozilla/netwerk/wifi/moz.build
-@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
-     CMMSRCS += [
+@@ -35,6 +35,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+     UNIFIED_SOURCES += [
          'osx_corewlan.mm',
      ]
 +elif CONFIG['OS_ARCH'] == 'FreeBSD':
-+    SOURCES += [
++    UNIFIED_SOURCES += [
 +        'nsWifiScannerFreeBSD.cpp',
 +    ]
  elif CONFIG['OS_ARCH'] == 'WINNT':
-     CPP_SOURCES += [
+     UNIFIED_SOURCES += [
          'nsWifiScannerWin.cpp',
 diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp
 new file mode 100644
 index 0000000..80d4cb6
 --- /dev/null
 +++ mozilla/netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,168 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this
 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -60,25 +60,19 @@
 +static nsresult
 +FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
 +{
-+  bool res = false;
-+  char *dupn = NULL;
-+  struct ifaddrs *ifal, *ifa;
-+  unsigned len;
-+
 +  // get list of interfaces
++  struct ifaddrs *ifal;
 +  if (getifaddrs(&ifal) < 0)
 +    return NS_ERROR_FAILURE;
 +
 +  accessPoints.Clear();
 +
 +  // loop through the interfaces
++  nsresult rv = NS_ERROR_FAILURE;
++  struct ifaddrs *ifa;
++  char *dupn = NULL;
 +  for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
-+    int s;
 +    struct ifreq ifr;
-+    struct ifmediareq ifmr;
-+    struct ieee80211req i802r;
-+    char iscanbuf[32*1024], *vsr;
-+
 +    memset(&ifr, 0, sizeof(ifr));
 +
 +    // list can contain duplicates, so ignore those
@@ -91,10 +85,12 @@
 +    ifr.ifr_addr.sa_family = AF_LOCAL;
 +
 +    // open socket to interface
-+    if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++    int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
++    if (s < 0)
 +      continue;
 +
 +    // clear interface media structure
++    struct ifmediareq ifmr;
 +    (void) memset(&ifmr, 0, sizeof(ifmr));
 +    (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
 +
@@ -111,6 +107,8 @@
 +    }
 +
 +    // perform WiFi scan
++    struct ieee80211req i802r;
++    char iscanbuf[32*1024];
 +    (void) memset(&i802r, 0, sizeof(i802r));
 +    (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
 +    i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
@@ -125,18 +123,15 @@
 +    close(s);
 +
 +    // loop through WiFi networks and build geoloc-lookup structure
-+    vsr = (char *) i802r.i_data;
-+    len = i802r.i_len;
++    char *vsr = (char *) i802r.i_data;
++    unsigned len = i802r.i_len;
 +    while (len >= sizeof(struct ieee80211req_scan_result)) {
-+      struct ieee80211req_scan_result *isr;
-+      char *id;
-+      int idlen;
-+      char ssid[IEEE80211_NWID_LEN+1];
-+      nsWifiAccessPoint *ap;
-+
-+      isr = (struct ieee80211req_scan_result *) vsr;
++      struct ieee80211req_scan_result *isr =
++        (struct ieee80211req_scan_result *) vsr;
 +
 +      // determine size of this entry
++      char *id;
++      int idlen;
 +      if (isr->isr_meshid_len) {
 +        id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
 +        idlen = isr->isr_meshid_len;
@@ -147,14 +142,15 @@
 +      }
 +
 +      // copy network data
++      char ssid[IEEE80211_NWID_LEN+1];
 +      strncpy(ssid, id, idlen);
 +      ssid[idlen] = '\0';
-+      ap = new nsWifiAccessPoint();
++      nsWifiAccessPoint *ap = new nsWifiAccessPoint();
 +      ap->setSSID(ssid, strlen(ssid));
 +      ap->setMac(isr->isr_bssid);
 +      ap->setSignal(isr->isr_rssi);
 +      accessPoints.AppendObject(ap);
-+      res = true;
++      rv = NS_OK;
 +
 +      // log the data
 +      LOG(( "FreeBSD access point: "
@@ -172,7 +168,7 @@
 +
 +  freeifaddrs(ifal);
 +
-+  return res ? NS_OK : NS_ERROR_FAILURE;
++  return rv;
 +}
 +
 +nsresult



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402151724.s1FHOTwP067037>