Changeset 2317


Ignore:
Timestamp:
Sep 25, 2005, 5:28:44 AM (20 years ago)
Author:
bird
Message:

unix attrs only for unix mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/sys/b_ioFileOpen.c

    • Property cvs2svn:cvs-rev changed from 1.11 to 1.12
    r2316 r2317  
    186186                 */
    187187                case S_IFREG:
     188                {
    188189                    /** @todo handle st_flags. */
    189190                    break;
     191                }
    190192
    191193                /*
     
    241243                 */
    242244                default:
    243                     __libc_Back_panic(0, NULL, "Invalid file type returned in st_mode=0x%x for '%s'\n", st.st_mode, szNativePath);
     245                    __libc_Back_panic(0, NULL, "Invalid file type returned in st_mode=%x for '%s'\n", st.st_mode, szNativePath);
    244246                    break;
    245247            }
     
    250252         * Create Unix attributes for a file which is potentially created / replaced.
    251253         */
     254        Mode &= ~__libc_gfsUMask;
     255        Mode &= ACCESSPERMS;
     256        Mode |= S_IFREG;
    252257        if (flOpenFlags & (OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_REPLACE_IF_EXISTS))
    253258        {
     
    262267        }
    263268    }
    264 
    265     /*
    266      * Normalize the mode mask and calc the file attributes.
    267      */
    268     Mode &= ~__libc_gfsUMask;
    269     Mode &= ACCESSPERMS;
    270     Mode |= S_IFREG;
    271 
    272     ULONG flAttr = Mode & S_IWUSR ? FILE_NORMAL : FILE_READONLY;
     269    else
     270    {
     271        /* Normalize the mode mask and calc the file attributes. */
     272        Mode &= ~__libc_gfsUMask;
     273        Mode &= ACCESSPERMS;
     274        Mode |= S_IFREG;
     275    }
    273276
    274277    /*
     
    276279     */
    277280    FS_VAR_SAVE_LOAD();
    278     ULONG   cExpandRetries;
    279     ULONG   ulAction;
    280     HFILE   hFile;
    281     for (cExpandRetries = 0;;)
     281    ULONG       flAttr = Mode & S_IWUSR || !Mode ? FILE_NORMAL : FILE_READONLY;
     282    ULONG       ulAction;
     283    HFILE       hFile;
     284    unsigned    cExpandRetries = 0;
     285    for (;;)
    282286    {
    283287#if OFF_MAX > LONG_MAX
Note: See TracChangeset for help on using the changeset viewer.