pg_dump's compression modules had variations on the theme of fp = fdopen(dup(fd), mode); if (fp == NULL) // fail, reporting errno which is problematic for two reasons. First, if dup() succeeds but fdopen() fails, we'd leak the duplicated FD. That's not important at present since the program will just exit immediately after failure anyway; but perhaps someday we'll try to continue, making the resource leak potentially significant. Second, if dup() fails then fdopen() will overwrite the useful errno (perhaps EMFILE) with a misleading value EBADF, making it difficult to understand what went wrong. Fix both issues by testing for dup() failure before proceeding to the next call. These failures are sufficiently unlikely, and the consequences minor enough, that this doesn't seem worth the effort to back-patch. But let's fix it in HEAD. Author: Jianghua Yang <yjhjstz@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/62bbe34d-2315-4b42-b768-56d901aa83e1@gmail.com |
||
|---|---|---|
| .github | ||
| config | ||
| contrib | ||
| doc | ||
| src | ||
| .cirrus.star | ||
| .cirrus.tasks.yml | ||
| .cirrus.yml | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| aclocal.m4 | ||
| configure | ||
| configure.ac | ||
| COPYRIGHT | ||
| GNUmakefile.in | ||
| HISTORY | ||
| Makefile | ||
| meson.build | ||
| meson_options.txt | ||
| README.md | ||
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.