postgresql/src
Michael Paquier 910e2aca12 Address set of issues with errno handling
System calls mixed up in error code paths are causing two issues which
several code paths have not correctly handled:
1) For write() calls, sometimes the system may return less bytes than
what has been written without errno being set.  Some paths were careful
enough to consider that case, and assumed that errno should be set to
ENOSPC, other calls missed that.
2) errno generated by a system call is overwritten by other system calls
which may succeed once an error code path is taken, causing what is
reported to the user to be incorrect.

This patch uses the brute-force approach of correcting all those code
paths.  Some refactoring could happen in the future, but this is let as
future work, which is not targeted for back-branches anyway.

Author: Michael Paquier
Reviewed-by: Ashutosh Sharma
Discussion: https://postgr.es/m/20180622061535.GD5215@paquier.xyz
2018-06-25 11:21:49 +09:00
..
backend Address set of issues with errno handling 2018-06-25 11:21:49 +09:00
bin Address set of issues with errno handling 2018-06-25 11:21:49 +09:00
common Enlarge find_other_exec's meager fgets buffer 2018-04-19 10:45:15 -03:00
include Support platforms where strtoll/strtoull are spelled __strtoll/__strtoull. 2018-05-19 14:22:18 -04:00
interfaces Avoid unnecessary use of strncpy in a couple of places in ecpg. 2018-06-16 14:58:36 -04:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:56 -04:00
pl Fix misidentification of SQL statement type in plpgsql's exec_stmt_execsql. 2018-05-25 14:31:07 -04:00
port Fix simple_prompt() to disable echo on Windows when stdin != terminal. 2018-05-23 19:04:34 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:29 -04:00
test Properly schema-qualify additional object types in getObjectDescription(). 2018-05-24 12:07:41 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:55:54 -04:00
tools Clear severity 5 perlcritic warnings from vcregress.pl 2018-05-06 07:39:51 -04:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in PL/Perl portability fix: absorb relevant -D switches from Perl. 2017-07-31 12:38:35 -04:00
Makefile.shlib Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00