Skip to content

Commit e57cd39

Browse files
committed
Make pg_archivecleanup log messages more consistent.
Erik Rijkers
1 parent 005e427 commit e57cd39

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

contrib/pg_archivecleanup/pg_archivecleanup.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pg_archivecleanup/pg_archivecleanup.c,v 1.3 2010/07/06 19:18:55 momjian Exp $
2+
* $PostgreSQL: pgsql/contrib/pg_archivecleanup/pg_archivecleanup.c,v 1.4 2010/08/23 02:56:24 tgl Exp $
33
*
44
* pg_archivecleanup.c
55
*
@@ -18,16 +18,16 @@
1818
#include <fcntl.h>
1919
#include <signal.h>
2020

21-
#ifdef WIN32
22-
int getopt(int argc, char *const argv[], const char *optstring);
23-
#else
21+
#ifndef WIN32
2422
#include <sys/time.h>
2523
#include <unistd.h>
2624

2725
#ifdef HAVE_GETOPT_H
2826
#include <getopt.h>
2927
#endif
30-
#endif /* ! WIN32 */
28+
#else /* WIN32 */
29+
extern int getopt(int argc, char *const argv[], const char *optstring);
30+
#endif /* ! WIN32 */
3131

3232
extern char *optarg;
3333
extern int optind;
@@ -117,12 +117,8 @@ CleanupPriorWALFiles(void)
117117
strspn(xlde->d_name, "0123456789ABCDEF") == XLOG_DATA_FNAME_LEN &&
118118
strcmp(xlde->d_name + 8, exclusiveCleanupFileName + 8) < 0)
119119
{
120-
#ifdef WIN32
121-
snprintf(WALFilePath, MAXPGPATH, "%s\\%s", archiveLocation, xlde->d_name);
122-
#else
123-
snprintf(WALFilePath, MAXPGPATH, "%s/%s", archiveLocation, xlde->d_name);
124-
#endif
125-
120+
snprintf(WALFilePath, MAXPGPATH, "%s/%s",
121+
archiveLocation, xlde->d_name);
126122
if (debug)
127123
fprintf(stderr, "%s: removing file \"%s\"\n",
128124
progname, WALFilePath);
@@ -308,8 +304,12 @@ main(int argc, char **argv)
308304
SetWALFileNameForCleanup();
309305

310306
if (debug)
307+
{
308+
snprintf(WALFilePath, MAXPGPATH, "%s/%s",
309+
archiveLocation, exclusiveCleanupFileName);
311310
fprintf(stderr, "%s: keep WAL file \"%s\" and later\n",
312-
progname, exclusiveCleanupFileName);
311+
progname, WALFilePath);
312+
}
313313

314314
/*
315315
* Remove WAL files older than cut-off

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy