[commit: packages/unix] ghc-7.8: Handle EROFS/ETXTBSY as permission denied in `fileAccess` (re #8741) (444750d)

git at git.haskell.org git at git.haskell.org
Fri Feb 28 23:39:48 UTC 2014


Repository : ssh://git@git.haskell.org/unix

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/444750d2e5c6b843b937cbe876ce248e76a2a245/unix

>---------------------------------------------------------------

commit 444750d2e5c6b843b937cbe876ce248e76a2a245
Author: Alain O'Dea <alain.odea at verafin.com>
Date:   Wed Feb 5 21:24:28 2014 +0000

    Handle EROFS/ETXTBSY as permission denied in `fileAccess` (re #8741)
    
    This extends `System.Posix.Files.`access` to map EROFS & ETXTBSY to
    mean permission denied just like EACCESS.
    
    Based on a patch by Alain O'Dea and comments by Duncan Coutts
    
    Authored-by: Alain O'Dea <alain.odea at verafin.com>
    Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
    
    (cherry picked from commit ecc92abad017cf12d8eb83509d4d57ae14ad47f9)


>---------------------------------------------------------------

444750d2e5c6b843b937cbe876ce248e76a2a245
 System/Posix/Files.hsc |    2 +-
 changelog.md           |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index 57f771e..704ef8a 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -151,7 +151,7 @@ access name flags =
     if (r == 0)
 	then return True
 	else do err <- getErrno
-	        if (err == eACCES)
+	        if (err == eACCES || err == eROFS || err == eTXTBSY)
 		   then return False
 		   else throwErrnoPath "fileAccess" name
 
diff --git a/changelog.md b/changelog.md
index 272c503..54e5a96 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,7 @@
+## 2.7.0.1
+
+  * Handle EROFS and ETXTBSY as (non-exceptional) permission denied in `fileAccess`
+
 ## 2.7.0.0  *Nov 2013*
 
   * New `forkProcessWithUnmask` function in the style of `forkIOWithUnmask`



More information about the ghc-commits mailing list