2008-08-25 Darren Kenny <[email protected]> VERMILLION_98
authordkenny
Mon, 25 Aug 2008 00:14:45 +0000
changeset 13267 5286201e1c28
parent 13266 7d3667ee29d3
child 13268 80b03cc3ab2f
2008-08-25 Darren Kenny <[email protected]> * patches/gnome-netstatus-07-wifi-info.diff: Fix a minor issue where I was incorrectly comparing strings sometimes with a zero length.
ChangeLog
patches/gnome-netstatus-07-wifi-info.diff
--- a/ChangeLog	Fri Aug 22 20:45:48 2008 +0000
+++ b/ChangeLog	Mon Aug 25 00:14:45 2008 +0000
@@ -1,3 +1,9 @@
+2008-08-25  Darren Kenny  <[email protected]>
+
+	* patches/gnome-netstatus-07-wifi-info.diff:
+	  Fix a minor issue where I was incorrectly comparing strings sometimes
+	  with a zero length.
+
 2008-08-22 Erwann Chenede - <[email protected]>
 
 	* patches/pixman-01-hide-private-functions.diff: match upstreamed 
--- a/patches/gnome-netstatus-07-wifi-info.diff	Fri Aug 22 20:45:48 2008 +0000
+++ b/patches/gnome-netstatus-07-wifi-info.diff	Mon Aug 25 00:14:45 2008 +0000
@@ -692,7 +692,7 @@
 
 diff -up gnome-netstatus-2.12.1/src/netstatus-dialog.c-clean gnome-netstatus-2.12.1/src/netstatus-dialog.c
 --- gnome-netstatus-2.12.1/src/netstatus-dialog.c-clean	2008-08-19 13:17:40.000000000 +0100
-+++ gnome-netstatus-2.12.1/src/netstatus-dialog.c	2008-08-21 23:33:40.580797833 +0100
++++ gnome-netstatus-2.12.1/src/netstatus-dialog.c	2008-08-25 01:07:29.312433183 +0100
 @@ -86,6 +86,10 @@ typedef struct
    GtkWidget      *signal_strength_frame;
    GtkWidget      *signal_strength_bar;
@@ -960,7 +960,18 @@
  
    netstatus_dialog_update_signal_strength (data);
  }
-@@ -1033,6 +1244,12 @@ netstatus_dialog_new (NetstatusIface *if
+@@ -1028,11 +1239,23 @@ netstatus_dialog_new (NetstatusIface *if
+ 					data->dialog);
+ 
+   netstatus_connect_signal_while_alive (data->iface,
++					"notify::connected",
++					G_CALLBACK (netstatus_dialog_iface_signal_strength_changed),
++					data,
++					data->dialog);
++
++  netstatus_connect_signal_while_alive (data->iface,
+ 					"notify::signal-strength",
+ 					G_CALLBACK (netstatus_dialog_iface_signal_strength_changed),
  					data,
  					data->dialog);
  
@@ -973,7 +984,7 @@
    g_signal_connect (data->dialog, "response",
  		    G_CALLBACK (netstatus_dialog_response), NULL);
  
-@@ -1040,11 +1257,13 @@ netstatus_dialog_new (NetstatusIface *if
+@@ -1040,11 +1263,13 @@ netstatus_dialog_new (NetstatusIface *if
  		    G_CALLBACK (netstatus_dialog_destroy), NULL);
  
    netstatus_dialog_setup_connection (data, xml);
@@ -990,7 +1001,7 @@
 
 diff -up gnome-netstatus-2.12.1/src/netstatus-iface.c-clean gnome-netstatus-2.12.1/src/netstatus-iface.c
 --- gnome-netstatus-2.12.1/src/netstatus-iface.c-clean	2008-08-19 13:17:40.000000000 +0100
-+++ gnome-netstatus-2.12.1/src/netstatus-iface.c	2008-08-22 11:31:26.652554174 +0100
++++ gnome-netstatus-2.12.1/src/netstatus-iface.c	2008-08-25 01:07:45.083067220 +0100
 @@ -1,5 +1,6 @@
  /*
   * Copyright (C) 2003-2004 Sun Microsystems, Inc.
@@ -1329,7 +1340,7 @@
  void
  netstatus_iface_set_error (NetstatusIface *iface,
  			   const GError   *error)
-@@ -591,14 +823,52 @@ netstatus_iface_poll_state (NetstatusIfa
+@@ -591,14 +823,53 @@ netstatus_iface_poll_state (NetstatusIfa
  
  static gboolean
  netstatus_iface_poll_wireless_details (NetstatusIface *iface,
@@ -1346,12 +1357,12 @@
    gboolean  is_wireless;
 +#if defined(__sun)
 +  wifi_info_t*  wi = netstatus_sysdeps_read_iface_wireless_details (iface->priv->name);
-+
+ 
 +  if ( wi != NULL ) {
 +    is_wireless = TRUE;
 +    if ( signal_strength )
 +      *signal_strength = wi->signal_strength;
- 
++
 +    if ( connected )
 +      *connected = wi->connected;
 +
@@ -1370,6 +1381,7 @@
 +    if ( auth_mode ) {
 +      *auth_mode = g_strdup( wi->auth_mode );
 +    }
++    netstatus_wifi_info_free(wi);
 +  }
 +  else {
 +    is_wireless = FALSE;
@@ -1384,7 +1396,7 @@
  
    if (error_message)
      {
-@@ -612,6 +882,7 @@ netstatus_iface_poll_wireless_details (N
+@@ -612,6 +883,7 @@ netstatus_iface_poll_wireless_details (N
  
    netstatus_iface_clear_error (iface, NETSTATUS_ERROR_WIRELESS_DETAILS);
  
@@ -1392,7 +1404,7 @@
    return is_wireless;
  }
  
-@@ -649,12 +920,20 @@ netstatus_iface_increase_poll_delay_in_e
+@@ -649,12 +921,20 @@ netstatus_iface_increase_poll_delay_in_e
      }
  }
  
@@ -1414,7 +1426,7 @@
   
    state = netstatus_iface_poll_state (iface);
  
-@@ -665,19 +944,103 @@ netstatus_iface_monitor_timeout (Netstat
+@@ -665,19 +945,103 @@ netstatus_iface_monitor_timeout (Netstat
        g_object_notify (G_OBJECT (iface), "state");
      }
  
@@ -1450,7 +1462,7 @@
 +      }
 +
 +    if (iface->priv->essid == NULL || 
-+        ( essid != NULL && strncmp(iface->priv->essid, essid, strlen(iface->priv->essid) ) != 0 ) )
++        ( essid != NULL && strcmp(iface->priv->essid, essid ) != 0 ) )
 +      {
 +        if ( iface->priv->essid != NULL )
 +            g_free(iface->priv->essid);
@@ -1464,7 +1476,7 @@
 +    }
 +
 +    if (iface->priv->bssid == NULL || 
-+        ( bssid != NULL && strncmp(iface->priv->bssid, bssid, strlen(iface->priv->bssid) ) != 0 ) )
++        ( bssid != NULL && strcmp(iface->priv->bssid, bssid ) != 0 ) )
 +      {
 +        if ( iface->priv->bssid != NULL )
 +            g_free(iface->priv->bssid);
@@ -1478,7 +1490,7 @@
 +    }
 +
 +    if (iface->priv->mode == NULL || 
-+        ( mode != NULL && strncmp(iface->priv->mode, mode, strlen(iface->priv->mode) ) != 0 ) )
++        ( mode != NULL && strcmp(iface->priv->mode, mode ) != 0 ) )
 +      {
 +        if ( iface->priv->mode != NULL )
 +            g_free(iface->priv->mode);
@@ -1492,7 +1504,7 @@
 +    }
 +
 +    if (iface->priv->security == NULL || 
-+        ( security != NULL && strncmp(iface->priv->security, security, strlen(iface->priv->security) ) != 0 ) )
++        ( security != NULL && strcmp(iface->priv->security, security ) != 0 ) )
 +      {
 +        if ( iface->priv->security != NULL )
 +            g_free(iface->priv->security);
@@ -1506,7 +1518,7 @@
      }
  
 +    if (iface->priv->auth_mode == NULL || 
-+        ( auth_mode != NULL && strncmp(iface->priv->auth_mode, auth_mode, strlen(iface->priv->auth_mode) ) != 0 ) )
++        ( auth_mode != NULL && strcmp(iface->priv->auth_mode, auth_mode ) != 0 ) )
 +      {
 +        if ( iface->priv->auth_mode != NULL )
 +            g_free(iface->priv->auth_mode);
@@ -1523,7 +1535,7 @@
    netstatus_iface_increase_poll_delay_in_error (iface);
    
    return TRUE;
-@@ -691,12 +1054,19 @@ netstatus_iface_init_monitor (NetstatusI
+@@ -691,12 +1055,19 @@ netstatus_iface_init_monitor (NetstatusI
    iface->priv->stats.in_bytes    = 0;
    iface->priv->stats.out_bytes   = 0;
    iface->priv->signal_strength   = 0;
@@ -1543,7 +1555,7 @@
    g_object_thaw_notify (G_OBJECT (iface));
  
    if (iface->priv->monitor_id)
-@@ -1230,6 +1600,7 @@ netstatus_list_interface_names (GError *
+@@ -1230,6 +1601,7 @@ netstatus_list_interface_names (GError *
  
    struct ifconf *if_conf;
    GList         *interfaces;
@@ -1551,7 +1563,7 @@
    GList         *loopbacks;
    char          *p;
    int            fd;
-@@ -1252,11 +1623,13 @@ netstatus_list_interface_names (GError *
+@@ -1252,11 +1624,13 @@ netstatus_list_interface_names (GError *
  
    interfaces = NULL;
    loopbacks  = NULL;
@@ -1565,7 +1577,7 @@
  
        p += sizeof (if_req->ifr_name) + NETSTATUS_SA_LEN (&if_req->ifr_addr);
  
-@@ -1271,16 +1644,21 @@ netstatus_list_interface_names (GError *
+@@ -1271,16 +1645,21 @@ netstatus_list_interface_names (GError *
        else
  	{
  	  loopback = (if_req->ifr_flags & IFF_LOOPBACK);
@@ -1590,7 +1602,7 @@
    interfaces = g_list_concat (interfaces, loopbacks);
  
    g_free (if_conf->ifc_buf);
-@@ -1512,3 +1890,97 @@ netstatus_iface_restart_interrupt (Netst
+@@ -1512,3 +1891,97 @@ netstatus_iface_restart_interrupt (Netst
  
    kill (iface->priv->restart_pid, SIGKILL);
  }