Ticket #7773: 0003-Correction-restore-the-oldMap-if-not-ok.patch

File 0003-Correction-restore-the-oldMap-if-not-ok.patch, 942 bytes (added by PHO, 13 months ago)

Correction of 7773.2.patch

  • GHC/Event/Manager.hs

    From 05592d2a1306c11f3ceb0f432f29510b72e1d49f Mon Sep 17 00:00:00 2001
    From: PHO <pho@cielonegro.org>
    Date: Tue, 19 Mar 2013 12:14:23 +0900
    Subject: [PATCH 3/3] Correction: restore the oldMap if not ok
    
    ---
     GHC/Event/Manager.hs | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/GHC/Event/Manager.hs b/GHC/Event/Manager.hs
    index 6021546..afaa9a3 100644
    a b registerFd_ mgr@(EventManager{..}) cb fd evs = do 
    312312      in do ok <- if modify 
    313313                  then I.modifyFd emBackend fd oldEvs newEvs 
    314314                  else return True 
    315             return (newMap, (modify, ok)) 
     315            if ok 
     316              then return (newMap, (modify, True)) 
     317              else return (oldMap, (False, False)) 
    316318  -- this simulates behavior of old IO manager: 
    317319  -- i.e. just call the callback if the registration fails. 
    318320  when (not ok) (cb reg evs)