fixed flags handling of ase_fio_open()
This commit is contained in:
@ -139,21 +139,23 @@ ase_fio_t* ase_fio_init (
|
||||
#endif
|
||||
/*
|
||||
* rwa -> RDWR | APPEND
|
||||
* ra -> RDONLY | APPEND
|
||||
* ra -> RDWR | APPEND
|
||||
* wa -> WRONLY | APPEND
|
||||
* a -> WRONLY | APPEND
|
||||
*/
|
||||
if ((flags & ASE_FIO_READ) &&
|
||||
(flags & ASE_FIO_WRITE)) desired_access |= O_RDWR;
|
||||
else if (flags & ASE_FIO_READ) desired_access |= O_RDONLY;
|
||||
else if (flags & ASE_FIO_WRITE) desired_access |= O_WRONLY;
|
||||
|
||||
if (flags & ASE_FIO_APPEND)
|
||||
{
|
||||
if (!(flags & ASE_FIO_READ) &&
|
||||
!(flags & ASE_FIO_WRITE)) desired_access |= O_WRONLY;
|
||||
if ((flags & ASE_FIO_READ)) desired_access |= O_RDWR;
|
||||
else desired_access |= O_WRONLY;
|
||||
desired_access |= O_APPEND;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((flags & ASE_FIO_READ) &&
|
||||
(flags & ASE_FIO_WRITE)) desired_access |= O_RDWR;
|
||||
else if (flags & ASE_FIO_READ) desired_access |= O_RDONLY;
|
||||
else if (flags & ASE_FIO_WRITE) desired_access |= O_WRONLY;
|
||||
}
|
||||
|
||||
if (flags & ASE_FIO_CREATE) desired_access |= O_CREAT;
|
||||
if (flags & ASE_FIO_TRUNCATE) desired_access |= O_TRUNC;
|
||||
|
Reference in New Issue
Block a user