Changeset 3469 for trunk/src


Ignore:
Timestamp:
Sep 16, 2020, 1:47:57 AM (5 years ago)
Author:
bird
Message:

kash: Use ntstat.c/h on windows, the crt version isn't reliable.

Location:
trunk/src/kash
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/Makefile.kmk

    r3466 r3469  
    134134        strsignal.c \
    135135        strlcpy.c \
     136       ../lib/nt/ntstat.c \
     137       ../lib/nt/nthlpcore.c \
     138       ../lib/nt/nthlpfs.c \
    136139       ../lib/nt/nt_child_inject_standard_handles.c
    137140ifdef KASH_WIN_FORKED_MODE
  • trunk/src/kash/shfile.c

    r3466 r3469  
    21582158    {
    21592159# if K_OS == K_OS_WINDOWS
     2160#  if 1
     2161        rc = birdStatFollowLink(abspath, pst);
     2162#  else
    21602163        int dir_slash = shfile_trailing_slash_hack(abspath);
    21612164        rc = stat(abspath, pst); /** @todo re-implement stat. */
     
    21642167            rc = -1;
    21652168            errno = ENOTDIR;
    2166         }
     2169
     2170       }
     2171#  endif
    21672172# else
    21682173        rc = stat(abspath, pst);
    21692174# endif
    21702175    }
    2171     TRACE2((NULL, "shfile_stat(,%s,) -> %d [%d]\n", path, rc, errno));
     2176    TRACE2((NULL, "shfile_stat(,%s,) -> %d [%d] st_size=%llu st_mode=%o\n",
     2177            path, rc, errno, (unsigned long long)pst->st_size, pst->st_mode));
    21722178    return rc;
    21732179#else
     
    21862192    {
    21872193# if K_OS == K_OS_WINDOWS
     2194#  if 1
     2195        rc = birdStatOnLink(abspath, pst);
     2196#  else
    21882197        int dir_slash = shfile_trailing_slash_hack(abspath);
    21892198        rc = stat(abspath, pst); /** @todo re-implement stat. */
     
    21932202            errno = ENOTDIR;
    21942203        }
     2204#  endif
    21952205# else
    21962206        rc = lstat(abspath, pst);
     
    22002210    rc = stat(path, pst);
    22012211#endif
    2202     TRACE2((NULL, "shfile_stat(,%s,) -> %d [%d]\n", path, rc, errno));
     2212    TRACE2((NULL, "shfile_lstat(,%s,) -> %d [%d] st_size=%llu st_mode=%o\n",
     2213            path, rc, errno, (unsigned long long)pst->st_size, pst->st_mode));
    22032214    return rc;
    22042215}
  • trunk/src/kash/shfile.h

    r3466 r3469  
    9595
    9696#endif
     97#if K_OS == K_OS_WINDOWS
     98# include "nt/ntstat.h"
     99#endif
    97100
    98101
Note: See TracChangeset for help on using the changeset viewer.