[commit: packages/unix] master, safe710fixes, safe710fixes-again, safefixes710again: Accept EPERM as valid error code for access(2) (3a0c0fe)
git at git.haskell.org
git at git.haskell.org
Thu Mar 19 15:50:05 UTC 2015
Repository : ssh://git@git.haskell.org/unix
On branches: master,safe710fixes,safe710fixes-again,safefixes710again
Link : http://ghc.haskell.org/trac/ghc/changeset/3a0c0fe1c8b2242250735675b64114fadbfc0aee/unix
>---------------------------------------------------------------
commit 3a0c0fe1c8b2242250735675b64114fadbfc0aee
Author: Clemens Lang <neverpanic at gmail.com>
Date: Sun Sep 21 17:49:16 2014 +0200
Accept EPERM as valid error code for access(2)
This is useful on OS X when its sandboxing mechanism is used, because
that will set errno = EPERM when a file can't be written due to
sandboxing (as opposed to setting it to EACCES when file permissions
deny writing).
>---------------------------------------------------------------
3a0c0fe1c8b2242250735675b64114fadbfc0aee
System/Posix/Files.hsc | 3 ++-
System/Posix/Files/ByteString.hsc | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index c8b5ddf..7c20987 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -152,7 +152,8 @@ access name flags =
if (r == 0)
then return True
else do err <- getErrno
- if (err == eACCES || err == eROFS || err == eTXTBSY)
+ if (err == eACCES || err == eROFS || err == eTXTBSY ||
+ err == ePERM)
then return False
else throwErrnoPath "fileAccess" name
diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc
index 1b346a7..dc1a3f8 100644
--- a/System/Posix/Files/ByteString.hsc
+++ b/System/Posix/Files/ByteString.hsc
@@ -158,7 +158,8 @@ access name flags =
if (r == 0)
then return True
else do err <- getErrno
- if (err == eACCES || err == eROFS || err == eTXTBSY)
+ if (err == eACCES || err == eROFS || err == eTXTBSY ||
+ err == ePERM)
then return False
else throwErrnoPath "fileAccess" name
More information about the ghc-commits
mailing list