Attachments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #1940: sl1940-register-session-failed-fix.patch

File sl1940-register-session-failed-fix.patch, 1.2 KB (added by bernie, 3 years ago)

fix for sugar 0.88

  • src/jarabe/model/network.py

    Martin Langhoff patch to solve registration session register failure.
    side effects.
    
    ---
     src/jarabe/model/network.py |   11 +++++++++++
      1 files changed, 11 insertions(+), 0 deletions(-)
    
    diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
    index 47db43f..218752c 100644
    a b  
    2727import gobject 
    2828import ConfigParser 
    2929import gconf 
     30import ctypes 
    3031 
    3132from sugar import dispatch 
    3233from sugar import env 
     
    501502                if self._settings.connection.type == NM_CONNECTION_TYPE_802_11_WIRELESS: 
    502503                    self.save() 
    503504 
     505        try: 
     506            # try to flush resolver cache - SL#1940 
     507            # ctypes' syntactic sugar does not work 
     508            # so we must get the func ptr explicitly 
     509            libc = ctypes.CDLL('libc.so.6') 
     510            res_init = getattr(libc, '__res_init') 
     511            res_init(None) 
     512        except: 
     513            logging.error('Error calling libc.__res_init') 
     514 
    504515    def set_secrets(self, secrets): 
    505516        self._secrets = secrets 
    506517        if self._settings.connection.type == NM_CONNECTION_TYPE_802_11_WIRELESS: