From 57b6dec74da8dcfd35f1500b259b8f6bdf0945d4 Mon Sep 17 00:00:00 2001 From: Fabio D'Urso Date: Sun, 14 Jan 2018 17:09:23 -0600 Subject: [PATCH] If we want to open read-only in losetup.c, flags should be O_RDONLY not O_RDWR --- drivers/loop/losetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/loop/losetup.c b/drivers/loop/losetup.c index 32c2f4d437..0690776e23 100644 --- a/drivers/loop/losetup.c +++ b/drivers/loop/losetup.c @@ -440,7 +440,7 @@ int losetup(FAR const char *devname, FAR const char *filename, { /* If that fails, then try to open the device read-only */ - fd = open(filename, O_RDWR); + fd = open(filename, O_RDONLY); if (fd < 0) { ret = -get_errno();