VirtualBox

Changeset 2309 in kBuild for trunk/src/kash/shfile.c


Ignore:
Timestamp:
Mar 1, 2009 10:01:39 AM (16 years ago)
Author:
bird
Message:

kash: some more file stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shfile.c

    r2307 r2309  
    12211221        sh_free(psh, free_me);
    12221222    }
     1223    else
     1224        rc = -1;
    12231225#else
    12241226    rc = chdir(path);
     
    12751277}
    12761278
     1279/**
     1280 * access().
     1281 */
    12771282int shfile_access(shfdtab *pfdtab, const char *path, int type)
    12781283{
     1284    int         rc;
     1285#ifdef SHFILE_IN_USE
     1286    char        abspath[SHFILE_MAX_PATH];
     1287
     1288    rc = shfile_make_path(pfdtab, path, &abspath[0]);
     1289    if (!rc)
     1290    {
    12791291# ifdef _MSC_VER
    1280     type &= ~X_OK;
    1281     return access(path, type);
    1282 # else
    1283     return access(path, type);
    1284 # endif
     1292        if (type & X_OK)
     1293            type = (type & ~X_OK) | R_OK;
     1294# endif
     1295        rc = access(abspath, type);
     1296    }
     1297#else
     1298# ifdef _MSC_VER
     1299    if (type & X_OK)
     1300        type = (type & ~X_OK) | R_OK;
     1301# endif
     1302    rc = access(path, type);
     1303#endif
     1304
     1305    TRACE2((NULL, "shfile_access(,%s,%#x) -> %d [%d]\n", path, type, rc, errno));
     1306    return rc;
    12851307}
    12861308
     
    12971319    {
    12981320# if K_OS == K_OS_WINDOWS
    1299         errno = ENOSYS;
     1321        rc = (file->shflags & SHFILE_FLAGS_TYPE_MASK) == SHFILE_FLAGS_TTY;
    13001322# else
    13011323        rc = isatty(file->native);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette