Re: [Try 5] msvcrt: Set permissions of file in sopen
23 Oct
2008
23 Oct
'08
4:22 a.m.
"Ivan Peevski" <cyberhorse(a)gmail.com> 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.
6263
Age (days ago)
6263
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dmitry Timoshkov