VirtualBox

Changeset 2592 in kBuild for trunk/src/kmk/w32


Ignore:
Timestamp:
Jun 17, 2012 10:50:38 PM (13 years ago)
Author:
bird
Message:

kmk build fixes for win.amd64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/w32/pathstuff.c

    r2591 r2592  
    143143
    144144        return p;
    145 }
    146 
    147 #undef stat
    148 /*
    149  * Workaround for directory names with trailing slashes.
    150  * Added by bird reasons stated.
    151  */
    152 int
    153 my_stat(const char *path, struct stat *st)
    154 {
    155     int rc = stat(path, st);
    156     if (    rc != 0
    157         &&  errno == ENOENT
    158         &&  *path != '\0')
    159       {
    160         char *slash = strchr(path, '\0') - 1;
    161         if (*slash == '/' || *slash == '\\')
    162           {
    163             size_t len_path = slash - path + 1;
    164             char *tmp = alloca(len_path + 4);
    165             memcpy(tmp, path, len_path);
    166             tmp[len_path] = '.';
    167             tmp[len_path + 1] = '\0';
    168             errno = 0;
    169             rc = stat(tmp, st);
    170             if (    rc == 0
    171                 &&  !S_ISDIR(st->st_mode))
    172               {
    173                 errno = ENOTDIR;
    174                 rc = -1;
    175               }
    176           }
    177       }
    178 #ifdef KMK_PRF
    179     {
    180         int err = errno;
    181         fprintf(stderr, "stat(%s,) -> %d/%d\n", path, rc, errno);
    182         errno = err;
    183     }
    184 #endif
    185     return rc;
    186145}
    187146
Note: See TracChangeset for help on using the changeset viewer.

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