diff options
Diffstat (limited to 'src/bin/pg_dump/pg_backup_directory.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_directory.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index 4b59516fe46..8d43cd2ade4 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -142,7 +142,7 @@ InitArchiveFmt_Directory(ArchiveHandle *AH) */ if (!AH->fSpec || strcmp(AH->fSpec, "") == 0) - die_horribly(AH, modulename, "no output directory specified\n"); + exit_horribly(modulename, "no output directory specified\n"); ctx->directory = AH->fSpec; @@ -160,9 +160,9 @@ InitArchiveFmt_Directory(ArchiveHandle *AH) tocFH = cfopen_read(fname, PG_BINARY_R); if (tocFH == NULL) - die_horribly(AH, modulename, - "could not open input file \"%s\": %s\n", - fname, strerror(errno)); + exit_horribly(modulename, + "could not open input file \"%s\": %s\n", + fname, strerror(errno)); ctx->dataFH = tocFH; @@ -177,7 +177,7 @@ InitArchiveFmt_Directory(ArchiveHandle *AH) /* Nothing else in the file, so close it again... */ if (cfclose(tocFH) != 0) - die_horribly(AH, modulename, "could not close TOC file: %s\n", + exit_horribly(modulename, "could not close TOC file: %s\n", strerror(errno)); ctx->dataFH = NULL; } @@ -288,8 +288,8 @@ _StartData(ArchiveHandle *AH, TocEntry *te) ctx->dataFH = cfopen_write(fname, PG_BINARY_W, AH->compression); if (ctx->dataFH == NULL) - die_horribly(AH, modulename, "could not open output file \"%s\": %s\n", - fname, strerror(errno)); + exit_horribly(modulename, "could not open output file \"%s\": %s\n", + fname, strerror(errno)); } /* @@ -346,7 +346,7 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt) cfp = cfopen_read(filename, PG_BINARY_R); if (!cfp) - die_horribly(AH, modulename, "could not open input file \"%s\": %s\n", + exit_horribly(modulename, "could not open input file \"%s\": %s\n", filename, strerror(errno)); buf = pg_malloc(ZLIB_OUT_SIZE); @@ -357,7 +357,7 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt) free(buf); if (cfclose(cfp) != 0) - die_horribly(AH, modulename, "could not close data file: %s\n", + exit_horribly(modulename, "could not close data file: %s\n", strerror(errno)); } @@ -397,8 +397,8 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt) ctx->blobsTocFH = cfopen_read(fname, PG_BINARY_R); if (ctx->blobsTocFH == NULL) - die_horribly(AH, modulename, "could not open large object TOC file \"%s\" for input: %s\n", - fname, strerror(errno)); + exit_horribly(modulename, "could not open large object TOC file \"%s\" for input: %s\n", + fname, strerror(errno)); /* Read the blobs TOC file line-by-line, and process each blob */ while ((cfgets(ctx->blobsTocFH, line, MAXPGPATH)) != NULL) @@ -407,8 +407,8 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt) char path[MAXPGPATH]; if (sscanf(line, "%u %s\n", &oid, fname) != 2) - die_horribly(AH, modulename, "invalid line in large object TOC file: %s\n", - line); + exit_horribly(modulename, "invalid line in large object TOC file: %s\n", + line); StartRestoreBlob(AH, oid, ropt->dropSchema); snprintf(path, MAXPGPATH, "%s/%s", ctx->directory, fname); @@ -416,12 +416,12 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt) EndRestoreBlob(AH, oid); } if (!cfeof(ctx->blobsTocFH)) - die_horribly(AH, modulename, "error reading large object TOC file \"%s\"\n", + exit_horribly(modulename, "error reading large object TOC file \"%s\"\n", fname); if (cfclose(ctx->blobsTocFH) != 0) - die_horribly(AH, modulename, "could not close large object TOC file \"%s\": %s\n", - fname, strerror(errno)); + exit_horribly(modulename, "could not close large object TOC file \"%s\": %s\n", + fname, strerror(errno)); ctx->blobsTocFH = NULL; @@ -441,7 +441,7 @@ _WriteByte(ArchiveHandle *AH, const int i) lclContext *ctx = (lclContext *) AH->formatData; if (cfwrite(&c, 1, ctx->dataFH) != 1) - die_horribly(AH, modulename, "could not write byte\n"); + exit_horribly(modulename, "could not write byte\n"); return 1; } @@ -460,7 +460,7 @@ _ReadByte(ArchiveHandle *AH) res = cfgetc(ctx->dataFH); if (res == EOF) - die_horribly(AH, modulename, "unexpected end of file\n"); + exit_horribly(modulename, "unexpected end of file\n"); return res; } @@ -477,7 +477,7 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len) res = cfwrite(buf, len, ctx->dataFH); if (res != len) - die_horribly(AH, modulename, "could not write to output file: %s\n", + exit_horribly(modulename, "could not write to output file: %s\n", strerror(errno)); return res; @@ -524,8 +524,8 @@ _CloseArchive(ArchiveHandle *AH) /* The TOC is always created uncompressed */ tocFH = cfopen_write(fname, PG_BINARY_W, 0); if (tocFH == NULL) - die_horribly(AH, modulename, "could not open output file \"%s\": %s\n", - fname, strerror(errno)); + exit_horribly(modulename, "could not open output file \"%s\": %s\n", + fname, strerror(errno)); ctx->dataFH = tocFH; /* @@ -538,8 +538,8 @@ _CloseArchive(ArchiveHandle *AH) AH->format = archDirectory; WriteToc(AH); if (cfclose(tocFH) != 0) - die_horribly(AH, modulename, "could not close TOC file: %s\n", - strerror(errno)); + exit_horribly(modulename, "could not close TOC file: %s\n", + strerror(errno)); WriteDataChunks(AH); } AH->FH = NULL; @@ -568,8 +568,8 @@ _StartBlobs(ArchiveHandle *AH, TocEntry *te) /* The blob TOC file is never compressed */ ctx->blobsTocFH = cfopen_write(fname, "ab", 0); if (ctx->blobsTocFH == NULL) - die_horribly(AH, modulename, "could not open output file \"%s\": %s\n", - fname, strerror(errno)); + exit_horribly(modulename, "could not open output file \"%s\": %s\n", + fname, strerror(errno)); } /* @@ -588,7 +588,7 @@ _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid) ctx->dataFH = cfopen_write(fname, PG_BINARY_W, AH->compression); if (ctx->dataFH == NULL) - die_horribly(AH, modulename, "could not open output file \"%s\": %s\n", + exit_horribly(modulename, "could not open output file \"%s\": %s\n", fname, strerror(errno)); } @@ -611,7 +611,7 @@ _EndBlob(ArchiveHandle *AH, TocEntry *te, Oid oid) /* register the blob in blobs.toc */ len = snprintf(buf, sizeof(buf), "%u blob_%u.dat\n", oid, oid); if (cfwrite(buf, len, ctx->blobsTocFH) != len) - die_horribly(AH, modulename, "could not write to blobs TOC file\n"); + exit_horribly(modulename, "could not write to blobs TOC file\n"); } /* @@ -667,7 +667,7 @@ prependDirectory(ArchiveHandle *AH, const char *relativeFilename) dname = ctx->directory; if (strlen(dname) + 1 + strlen(relativeFilename) + 1 > MAXPGPATH) - die_horribly(AH, modulename, "path name too long: %s", dname); + exit_horribly(modulename, "path name too long: %s", dname); strcpy(buf, dname); strcat(buf, "/"); |