Ticket #5013: 0001-fix-getFileStatus-interrupted-Interrupted-system-cal.patch

File 0001-fix-getFileStatus-interrupted-Interrupted-system-cal.patch, 1.8 KB (added by kgardas, 15 months ago)
  • System/Posix/Files.hsc

    From ce56587f356adb11176a11881c9d6be72f4dc85f Mon Sep 17 00:00:00 2001
    From: Karel Gardas <[email protected]>
    Date: Wed, 26 Feb 2014 12:14:26 +0100
    Subject: [PATCH] fix getFileStatus: interrupted (Interrupted system call)
     build failure on Solaris
    
    Patch provided by Christian Maeder <[email protected]>
    
    Signed-off-by: Karel Gardas <[email protected]>
    ---
     System/Posix/Files.hsc            |    3 ++-
     System/Posix/Files/ByteString.hsc |    2 +-
     2 files changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
    index 49c9bc1..a54443a 100644
    a b import Foreign.C 
    9696 
    9797import System.Posix.Types 
    9898import System.Posix.Files.Common 
     99import System.Posix.Error 
    99100import System.Posix.Internals 
    100101 
    101102import Data.Time.Clock.POSIX 
    getFileStatus path = do 
    165166  fp <- mallocForeignPtrBytes (#const sizeof(struct stat)) 
    166167  withForeignPtr fp $ \p -> 
    167168    withFilePath path $ \s -> 
    168       throwErrnoPathIfMinus1_ "getFileStatus" path (c_stat s p) 
     169      throwErrnoPathIfMinus1Retry_ "getFileStatus" path (c_stat s p) 
    169170  return (FileStatus fp) 
    170171 
    171172-- | Acts as 'getFileStatus' except when the 'FilePath' refers to a symbolic 
  • System/Posix/Files/ByteString.hsc

    diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc
    index b25a823..4f8a05f 100644
    a b getFileStatus path = do 
    172172  fp <- mallocForeignPtrBytes (#const sizeof(struct stat))  
    173173  withForeignPtr fp $ \p -> 
    174174    withFilePath path $ \s ->  
    175       throwErrnoPathIfMinus1_ "getFileStatus" path (c_stat s p) 
     175      throwErrnoPathIfMinus1Retry_ "getFileStatus" path (c_stat s p) 
    176176  return (FileStatus fp) 
    177177 
    178178-- | Acts as 'getFileStatus' except when the 'RawFilePath' refers to a symbolic