Changeset 2857 for trunk/src/kmk
- Timestamp:
- Sep 1, 2016, 5:39:51 AM (9 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/dir-nt-bird.c
r2856 r2857 212 212 if (pDirObj->bObjType == KFSOBJ_TYPE_DIR) 213 213 { 214 KMKNTOPENDIR *pDir = xmalloc(sizeof(*pDir)); 215 pDir->pDir = (PKFSDIR)pDirObj; 216 pDir->idxNext = 0; 217 return pDir; 218 } 214 if (kFsCacheDirEnsurePopuplated(g_pFsCache, (PKFSDIR)pDirObj, NULL)) 215 { 216 KMKNTOPENDIR *pDir = xmalloc(sizeof(*pDir)); 217 pDir->pDir = (PKFSDIR)pDirObj; 218 pDir->idxNext = 0; 219 return pDir; 220 } 221 } 222 kFsCacheObjRelease(g_pFsCache, pDirObj); 219 223 } 220 224 return NULL; … … 330 334 } 331 335 kFsCacheObjRelease(g_pFsCache, pPathObj); 332 } 333 errno = ENOENT; 336 errno = ENOENT; 337 } 338 else 339 errno = enmError == KFSLOOKUPERROR_NOT_DIR 340 || enmError == KFSLOOKUPERROR_PATH_COMP_NOT_DIR 341 ? ENOTDIR : ENOENT; 342 334 343 return -1; 335 344 } … … 438 447 } 439 448 449 450 /** 451 * Special stat call used by remake.c 452 * 453 * @returns 0 on success, -1 + errno on failure. 454 * @param pszPath The path to stat. 455 * @param pStat Where to return the mtime field only. 456 */ 457 int stat_only_mtime(const char *pszPath, struct stat *pStat) 458 { 459 if (commands_started == 0) 460 { 461 KFSLOOKUPERROR enmError; 462 PKFSOBJ pPathObj = kFsCacheLookupA(g_pFsCache, pszPath, &enmError); 463 if (pPathObj) 464 { 465 if (pPathObj->bObjType != KFSOBJ_TYPE_MISSING) 466 { 467 kHlpAssert(pPathObj->fHaveStats); /* currently always true. */ 468 pStat->st_mtime = pPathObj->Stats.st_mtime; 469 kFsCacheObjRelease(g_pFsCache, pPathObj); 470 return 0; 471 } 472 473 kFsCacheObjRelease(g_pFsCache, pPathObj); 474 errno = ENOENT; 475 } 476 else 477 errno = enmError == KFSLOOKUPERROR_NOT_DIR 478 || enmError == KFSLOOKUPERROR_PATH_COMP_NOT_DIR 479 ? ENOTDIR : ENOENT; 480 return -1; 481 } 482 /** @todo implement cache refreshing. */ 483 return birdStatFollowLink(pszPath, pStat); 484 } 485 -
trunk/src/kmk/read.c
r2799 r2857 532 532 void *stream_buf = NULL; 533 533 struct stat st; 534 # ifdef KBUILD_OS_WINDOWS 535 if (!birdStatOnFdJustSize(fileno(ebuf.fp), &st.st_size)) 536 # else 534 537 if (!fstat (fileno (ebuf.fp), &st)) 538 # endif 535 539 { 536 540 int stream_buf_size = 256*1024; -
trunk/src/kmk/remake.c
r2754 r2857 1794 1794 int e; 1795 1795 1796 #if defined(KMK) && defined(KBUILD_OS_WINDOWS) 1797 extern int stat_only_mtime(const char *pszPath, struct stat *pStat); 1798 e = stat_only_mtime (name, &st); 1799 #else 1796 1800 EINTRLOOP (e, stat (name, &st)); 1801 #endif 1797 1802 if (e == 0) 1798 1803 mtime = FILE_TIMESTAMP_STAT_MODTIME (name, st);
Note:
See TracChangeset
for help on using the changeset viewer.