If we want to open read-only in losetup.c, flags should be O_RDONLY not O_RDWR
This commit is contained in:
parent
fd5d811b0a
commit
57b6dec74d
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user