Thanks to visit codestin.com
Credit goes to github.com

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

+7-1
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)