Skip to content

Commit 9f73b86

Browse files
jeffhostetlerdscho
authored andcommitted
fscache: add key for GIT_TRACE_FSCACHE
Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 25d264c commit 9f73b86

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compat/win32/fscache.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
#include "fscache.h"
55
#include "../../dir.h"
66
#include "../../abspath.h"
7+
#include "../../trace.h"
78

89
static int initialized;
910
static volatile long enabled;
1011
static struct hashmap map;
1112
static CRITICAL_SECTION mutex;
13+
static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);
1214

1315
/*
1416
* An entry in the file system cache. Used for both entire directory listings
@@ -212,6 +214,8 @@ static struct fsentry *fsentry_create_list(const struct fsentry *dir)
212214
if (h == INVALID_HANDLE_VALUE) {
213215
err = GetLastError();
214216
errno = (err == ERROR_DIRECTORY) ? ENOTDIR : err_win_to_posix(err);
217+
trace_printf_key(&trace_fscache, "fscache: error(%d) '%s'\n",
218+
errno, dir->dirent.d_name);
215219
return NULL;
216220
}
217221

@@ -397,6 +401,7 @@ int fscache_enable(int enable)
397401
fscache_clear();
398402
LeaveCriticalSection(&mutex);
399403
}
404+
trace_printf_key(&trace_fscache, "fscache: enable(%d)\n", enable);
400405
return result;
401406
}
402407

0 commit comments

Comments
 (0)