Skip to content

Commit 98bd4c7

Browse files
committed
pg_dump: Have _EndLO report errno after CFH->write_func() failure
Other callers of that function do things this way, but this one didn't get the memo.
1 parent 69c4306 commit 98bd4c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bin/pg_dump/pg_backup_directory.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,13 @@ _EndLO(ArchiveHandle *AH, TocEntry *te, Oid oid)
697697
/* register the LO in blobs.toc */
698698
len = snprintf(buf, sizeof(buf), "%u blob_%u.dat\n", oid, oid);
699699
if (!CFH->write_func(buf, len, CFH))
700-
pg_fatal("could not write to LOs TOC file");
700+
{
701+
/* if write didn't set errno, assume problem is no disk space */
702+
if (errno == 0)
703+
errno = ENOSPC;
704+
pg_fatal("could not write to LOs TOC file: %s",
705+
CFH->get_error_func(CFH));
706+
}
701707
}
702708

703709
/*

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