diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c index 5d54a7116a9..6cb2bf47568 100644 --- a/src/bin/pg_resetwal/pg_resetwal.c +++ b/src/bin/pg_resetwal/pg_resetwal.c @@ -1043,6 +1043,8 @@ KillExistingArchiveStatus(void) if (closedir(xldir)) pg_fatal("could not close directory \"%s\": %m", ARCHSTATDIR); + +#undef ARCHSTATDIR } /* @@ -1077,7 +1079,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 } /*