If we want to open read-only in losetup.c, flags should be O_RDONLY not O_RDWR

This commit is contained in:
Fabio D'Urso 2018-01-14 17:09:23 -06:00 committed by Gregory Nutt
parent fd5d811b0a
commit 57b6dec74d
1 changed files with 1 additions and 1 deletions

View File

@ -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();