Skip to content

Commit 8d16a41

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 b1a0f3f commit 8d16a41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/win32/fscache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ static int initialized;
77
static volatile long enabled;
88
static struct hashmap map;
99
static CRITICAL_SECTION mutex;
10+
static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);
1011

1112
/*
1213
* An entry in the file system cache. Used for both entire directory listings
@@ -200,6 +201,8 @@ static struct fsentry *fsentry_create_list(const struct fsentry *dir)
200201
if (h == INVALID_HANDLE_VALUE) {
201202
err = GetLastError();
202203
errno = (err == ERROR_DIRECTORY) ? ENOTDIR : err_win_to_posix(err);
204+
trace_printf_key(&trace_fscache, "fscache: error(%d) '%s'\n",
205+
errno, dir->dirent.d_name);
203206
return NULL;
204207
}
205208

@@ -385,6 +388,7 @@ int fscache_enable(int enable)
385388
fscache_clear();
386389
LeaveCriticalSection(&mutex);
387390
}
391+
trace_printf_key(&trace_fscache, "fscache: enable(%d)\n", enable);
388392
return result;
389393
}
390394

0 commit comments

Comments
 (0)