summaryrefslogtreecommitdiffstats
path: root/mdopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdopen.c')
-rw-r--r--mdopen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdopen.c b/mdopen.c
index 21baf5da..0a174211 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -390,6 +390,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
int open_mddev(char *dev, int report_errors)
{
int mdfd = open(dev, O_RDWR);
+ if (mdfd < 0 && errno == EACCES)
+ mdfd = open(dev, O_RDONLY);
if (mdfd < 0) {
if (report_errors)
fprintf(stderr, Name ": error opening %s: %s\n",