diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2006-05-22 11:21:54 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2006-05-22 11:21:54 +0000 |
commit | 79e371037b960208c7febb4b292fb701a3f2a862 (patch) | |
tree | 75ba34f3c29966e5b285b320226054d322bfafa1 /src/bin/pg_dump/pg_backup_tar.c | |
parent | e9cc53025ad4bf3a1a7287192ba47fbbf4aac826 (diff) |
Add strerror to pg_dump error messages where missing.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_tar.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_tar.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index b777fa140e5..bb490e2aefb 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -16,7 +16,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.50 2006/02/12 06:11:50 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.51 2006/05/22 11:21:54 petere Exp $ * *------------------------------------------------------------------------- */ @@ -546,8 +546,7 @@ tarWrite(const void *buf, size_t len, TAR_MEMBER *th) if (res != len) die_horribly(th->AH, modulename, - "could not write to tar member (wrote %lu, attempted %lu)\n", - (unsigned long) res, (unsigned long) len); + "could not write to output file: %s\n", strerror(errno)); th->pos += res; return res; @@ -1035,13 +1034,12 @@ _tarAddFile(ArchiveHandle *AH, TAR_MEMBER *th) res = fwrite(&buf[0], 1, cnt, th->tarFH); if (res != cnt) die_horribly(AH, modulename, - "write error appending to tar archive (wrote %lu, attempted %lu)\n", - (unsigned long) res, (unsigned long) cnt); + "could not write to output file: %s\n", strerror(errno)); len += res; } if (fclose(tmp) != 0) /* This *should* delete it... */ - die_horribly(AH, modulename, "could not close tar member: %s\n", strerror(errno)); + die_horribly(AH, modulename, "could not close temporary file: %s\n", strerror(errno)); if (len != th->fileLen) { @@ -1327,6 +1325,6 @@ _tarWriteHeader(TAR_MEMBER *th) } if (fwrite(h, 1, 512, th->tarFH) != 512) - die_horribly(th->AH, modulename, "could not write tar header\n"); + die_horribly(th->AH, modulename, "could not write to output file: %s\n", strerror(errno)); } |