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

« back to all changes in this revision

Viewing changes to src/bin/pg_dump/pg_backup_custom.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 *
20
20
 *
21
21
 * IDENTIFICATION
22
 
 *              $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.41 2009/02/02 20:07:37 adunstan Exp $
 
22
 *              $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.42 2009/06/11 14:49:07 momjian Exp $
23
23
 *
24
24
 *-------------------------------------------------------------------------
25
25
 */
133
133
        AH->StartBlobPtr = _StartBlob;
134
134
        AH->EndBlobPtr = _EndBlob;
135
135
        AH->EndBlobsPtr = _EndBlobs;
136
 
        AH->ClonePtr = _Clone;  
137
 
        AH->DeClonePtr = _DeClone;      
 
136
        AH->ClonePtr = _Clone;
 
137
        AH->DeClonePtr = _DeClone;
138
138
 
139
139
        /*
140
140
         * Set up some special context used in compressing data.
842
842
 * is because on Windows, this is used within a multithreading context,
843
843
 * and we don't want a thread closing the parent file handle.)
844
844
 */
845
 
static void 
 
845
static void
846
846
_ReopenArchive(ArchiveHandle *AH)
847
847
{
848
848
        lclContext *ctx = (lclContext *) AH->formatData;
849
849
        pgoff_t         tpos;
850
850
 
851
851
        if (AH->mode == archModeWrite)
852
 
                die_horribly(AH,modulename,"can only reopen input archives\n");
 
852
                die_horribly(AH, modulename, "can only reopen input archives\n");
853
853
        if (AH->fSpec == NULL || strcmp(AH->fSpec, "") == 0)
854
 
                die_horribly(AH,modulename,"cannot reopen stdin\n");
 
854
                die_horribly(AH, modulename, "cannot reopen stdin\n");
855
855
        if (!ctx->hasSeek)
856
 
                die_horribly(AH,modulename,"cannot reopen non-seekable file\n");
 
856
                die_horribly(AH, modulename, "cannot reopen non-seekable file\n");
857
857
 
858
858
        errno = 0;
859
859
        tpos = ftello(AH->FH);
860
860
        if (errno)
861
 
                die_horribly(AH, modulename, "could not determine seek position in archive file: %s\n", 
 
861
                die_horribly(AH, modulename, "could not determine seek position in archive file: %s\n",
862
862
                                         strerror(errno));
863
863
 
864
864
#ifndef WIN32
865
865
        if (fclose(AH->FH) != 0)
866
 
                die_horribly(AH, modulename, "could not close archive file: %s\n", 
 
866
                die_horribly(AH, modulename, "could not close archive file: %s\n",
867
867
                                         strerror(errno));
868
868
#endif
869
869
 
873
873
                                         AH->fSpec, strerror(errno));
874
874
 
875
875
        if (fseeko(AH->FH, tpos, SEEK_SET) != 0)
876
 
                die_horribly(AH, modulename, "could not set seek position in archive file: %s\n", 
 
876
                die_horribly(AH, modulename, "could not set seek position in archive file: %s\n",
877
877
                                         strerror(errno));
878
878
}
879
879
 
1085
1085
                die_horribly(AH, modulename, "out of memory\n");
1086
1086
 
1087
1087
        /*
1088
 
         * Note: we do not make a local lo_buf because we expect at most one
1089
 
         * BLOBS entry per archive, so no parallelism is possible.  Likewise,
 
1088
         * Note: we do not make a local lo_buf because we expect at most one BLOBS
 
1089
         * entry per archive, so no parallelism is possible.  Likewise,
1090
1090
         * TOC-entry-local state isn't an issue because any one TOC entry is
1091
1091
         * touched by just one worker child.
1092
1092
         */
1096
1096
_DeClone(ArchiveHandle *AH)
1097
1097
{
1098
1098
        lclContext *ctx = (lclContext *) AH->formatData;
1099
 
        
 
1099
 
1100
1100
        free(ctx->zlibOut);
1101
1101
        free(ctx->zlibIn);
1102
1102
        free(ctx->zp);