We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 844f8d8 commit bfb0fb7Copy full SHA for bfb0fb7
src/packcc.c
@@ -954,7 +954,14 @@ static void file_pos__term(file_pos_t *pos) {
954
955
static void file_id__get(FILE *file, const char *path, file_id_t *id) {
956
#ifdef _WIN32 /* Windows including MSVC and MinGW */
957
- if (GetFileInformationByHandle((HANDLE)_get_osfhandle(_fileno(file)), id) == 0) {
+ const int f = _fileno(file);
958
+ if (f <= 2) { /* standard input/output/error */
959
+ id->dwVolumeSerialNumber = ~(DWORD)0;
960
+ id->nFileIndexHigh = 0;
961
+ id->nFileIndexLow = f;
962
+ return;
963
+ }
964
+ if (GetFileInformationByHandle((HANDLE)_get_osfhandle(f), id) == 0) {
965
print_error("Cannot get file information: %s\n", path);
966
exit(2);
967
}
0 commit comments