Changeset 3662 in kBuild
- Timestamp:
- Feb 20, 2025 4:30:45 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/output.c
r3563 r3662 58 58 #else 59 59 # define STREAM_OK(_s) 1 60 #endif 61 62 #if defined(KMK) && defined(KBUILD_OS_WINDOWS) && 1 63 /* fflush wrapper w/ error checking + reporting for stdout. 64 This is to debug the mysterious 'kmk: write error: stdout' errors. */ 65 int g_fStdOutError = 0; 66 67 static int my_fflush (FILE *pFile) 68 { 69 if (pFile == stdout && !g_fStdOutError) 70 { 71 if (!ferror (pFile)) 72 { 73 int rcRet = fflush (pFile); 74 g_fStdOutError = ferror(g_fStdOutError); 75 if (rcRet != EOF && !g_fStdOutError) 76 { /* likely */ } 77 else if (rcRet == EOF) 78 fprintf (stderr, "kmk: fflush(stdout): flush failed! errno=%d\n", errno); 79 else 80 fprintf (stderr, "kmk: fflush(stdout): error pending after successful flush! errno=%d\n", errno); 81 82 return rcRet; 83 } 84 else 85 { 86 fprintf (stderr, "kmk: fflush(stdout): error pending on entry! errno=%d\n", errno); 87 g_fStdOutError = 1; 88 } 89 90 } 91 return fflush (pFile); 92 } 93 94 # undef fflush 95 # undef fflush(a_pFile) my_fflush(a_pFile) 96 60 97 #endif 61 98 … … 194 231 } 195 232 if (dst != prevdst) 196 fflush (prevdst);233 fflush (prevdst); 197 234 prevdst = dst; 198 235 #ifdef KMK
Note:
See TracChangeset
for help on using the changeset viewer.