hostfs: mask bit fields of not support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
parent
52096aeb80
commit
7f5e6bd383
@ -76,6 +76,8 @@ static ssize_t host_flen(long fd)
|
||||
|
||||
static int host_flags_to_mode(int flags)
|
||||
{
|
||||
static const int modemasks = O_RDONLY | O_WRONLY | O_TEXT | O_RDWR |
|
||||
O_CREAT | O_TRUNC | O_APPEND;
|
||||
static const int modeflags[] =
|
||||
{
|
||||
O_RDONLY | O_TEXT,
|
||||
@ -96,7 +98,7 @@ static int host_flags_to_mode(int flags)
|
||||
int i;
|
||||
for (i = 0; modeflags[i] != 0; i++)
|
||||
{
|
||||
if (modeflags[i] == flags)
|
||||
if ((modemasks & flags) == modeflags[i])
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
@ -76,6 +76,8 @@ static ssize_t host_flen(long fd)
|
||||
|
||||
static int host_flags_to_mode(int flags)
|
||||
{
|
||||
static const int modemasks = O_RDONLY | O_WRONLY | O_TEXT | O_RDWR |
|
||||
O_CREAT | O_TRUNC | O_APPEND;
|
||||
static const int modeflags[] =
|
||||
{
|
||||
O_RDONLY | O_TEXT,
|
||||
@ -96,7 +98,7 @@ static int host_flags_to_mode(int flags)
|
||||
int i;
|
||||
for (i = 0; modeflags[i] != 0; i++)
|
||||
{
|
||||
if (modeflags[i] == flags)
|
||||
if ((modemasks & flags) == modeflags[i])
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
@ -76,6 +76,8 @@ static ssize_t host_flen(long fd)
|
||||
|
||||
static int host_flags_to_mode(int flags)
|
||||
{
|
||||
static const int modemasks = O_RDONLY | O_WRONLY | O_TEXT | O_RDWR |
|
||||
O_CREAT | O_TRUNC | O_APPEND;
|
||||
static const int modeflags[] =
|
||||
{
|
||||
O_RDONLY | O_TEXT,
|
||||
@ -96,7 +98,7 @@ static int host_flags_to_mode(int flags)
|
||||
int i;
|
||||
for (i = 0; modeflags[i] != 0; i++)
|
||||
{
|
||||
if (modeflags[i] == flags)
|
||||
if ((modemasks & flags) == modeflags[i])
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user