1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-29 16:21:20 +03:00

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.
This commit is contained in:
Alvaro Herrera 2023-05-17 18:55:51 +02:00
parent 69c430626b
commit 98bd4c72fd
No known key found for this signature in database
GPG Key ID: 1C20ACB9D5C564AE

View File

@ -697,7 +697,13 @@ _EndLO(ArchiveHandle *AH, TocEntry *te, Oid oid)
/* register the LO in blobs.toc */
len = snprintf(buf, sizeof(buf), "%u blob_%u.dat\n", oid, oid);
if (!CFH->write_func(buf, len, CFH))
pg_fatal("could not write to LOs TOC file");
{
/* if write didn't set errno, assume problem is no disk space */
if (errno == 0)
errno = ENOSPC;
pg_fatal("could not write to LOs TOC file: %s",
CFH->get_error_func(CFH));
}
}
/*