Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlainODea/8837579 to your computer and use it in GitHub Desktop.
Save AlainODea/8837579 to your computer and use it in GitHub Desktop.
Patch for defect in System.Posix.fileAccess on a read-only file system.
From 5c5ea6bb96522a42634c9e803f387a617c70238e Mon Sep 17 00:00:00 2001
From: Alain O'Dea <[email protected]>
Date: Wed, 5 Feb 2014 21:24:28 +0000
Subject: [PATCH] BUGFIX: Handle eROFS as permission denied
---
System/Posix/Files.hsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index 57f771e..b79b725 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)
then return False
else throwErrnoPath "fileAccess" name
--
1.8.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment