diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c index 3cbf898d031..efb515e8a1a 100644 --- a/src/bin/pg_resetwal/pg_resetwal.c +++ b/src/bin/pg_resetwal/pg_resetwal.c @@ -1067,6 +1067,8 @@ KillExistingArchiveStatus(void) if (closedir(xldir)) pg_fatal("could not close directory \"%s\": %m", ARCHSTATDIR); + +#undef ARCHSTATDIR } /* @@ -1101,7 +1103,10 @@ KillExistingWALSummaries(void) pg_fatal("could not read directory \"%s\": %m", WALSUMMARYDIR); if (closedir(xldir)) - pg_fatal("could not close directory \"%s\": %m", ARCHSTATDIR); + pg_fatal("could not close directory \"%s\": %m", WALSUMMARYDIR); + +#undef WALSUMMARY_NHEXCHARS +#undef WALSUMMARYDIR } /*