diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index dac5bca..36f751c 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -562,16 +562,15 @@ pgstat_reset_remove_files(const char *directory) struct dirent *entry; char fname[MAXPGPATH]; - dir = AllocateDir(pgstat_stat_directory); - while ((entry = ReadDir(dir, pgstat_stat_directory)) != NULL) + dir = AllocateDir(directory); + while ((entry = ReadDir(dir, directory)) != NULL) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) continue; /* XXX should we try to ignore files other than the ones we write? */ - snprintf(fname, MAXPGPATH, "%s/%s", pgstat_stat_directory, - entry->d_name); + snprintf(fname, MAXPGPATH, "%s/%s", directory, entry->d_name); unlink(fname); } FreeDir(dir);