~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/bin/pg_resetxlog/pg_resetxlog.c

Tags: upstream-8.4.0
ImportĀ upstreamĀ versionĀ 8.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
24
24
 * Portions Copyright (c) 1994, Regents of the University of California
25
25
 *
26
 
 * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.73 2009/05/03 23:13:37 tgl Exp $
 
26
 * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.74 2009/06/11 14:49:07 momjian Exp $
27
27
 *
28
28
 *-------------------------------------------------------------------------
29
29
 */
31
31
/*
32
32
 * We have to use postgres.h not postgres_fe.h here, because there's so much
33
33
 * backend-only stuff in the XLOG include files we need.  But we need a
34
 
 * frontend-ish environment otherwise.  Hence this ugly hack.
 
34
 * frontend-ish environment otherwise.  Hence this ugly hack.
35
35
 */
36
36
#define FRONTEND 1
37
37
 
823
823
        struct dirent *xlde;
824
824
        char            path[MAXPGPATH];
825
825
 
826
 
#define ARCHSTATDIR     XLOGDIR "/archive_status"
 
826
#define ARCHSTATDIR XLOGDIR "/archive_status"
827
827
 
828
828
        xldir = opendir(ARCHSTATDIR);
829
829
        if (xldir == NULL)
838
838
        {
839
839
                if (strspn(xlde->d_name, "0123456789ABCDEF") == 24 &&
840
840
                        (strcmp(xlde->d_name + 24, ".ready") == 0 ||
841
 
                         strcmp(xlde->d_name + 24, ".done")  == 0))
 
841
                         strcmp(xlde->d_name + 24, ".done") == 0))
842
842
                {
843
843
                        snprintf(path, MAXPGPATH, "%s/%s", ARCHSTATDIR, xlde->d_name);
844
844
                        if (unlink(path) < 0)