mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
If we want to open read-only in losetup.c, flags should be O_RDONLY not O_RDWR
This commit is contained in:
committed by
Gregory Nutt
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();
|
||||
|
||||
Reference in New Issue
Block a user