"Ivan Peevski" <[EMAIL PROTECTED]> wrote:

> the pmode flag test should be:
> if it has the IREAD but not the IWRITE flag (read only)
> does that make sense? Is it doing what I think it is?

It should be:

if ((pmode & MSVCRT__S_IREAD) && !(pmode & MSVCRT__S_IWRITE))
    ...;

IMO it would be more convenient to use switch, that would cover
all the possible cases:

switch (pmode & (MSVCRT__S_IREAD | MSVCRT__S_IWRITE))
{
case 0:
...
case MSVCRT__S_IREAD | MSVCRT__S_IWRITE:
...
case MSVCRT__S_IREAD:
...
case MSVCRT__S_IWRITE:
...
}

Of course a test is needed to prove that.

-- 
Dmitry.


Reply via email to