postgresql/src/bin
Michael Paquier 7fdf56b0a7 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:20:50 +09:00
..
initdb Translation updates 2018-02-05 12:38:16 -05:00
pg_archivecleanup Fix new warnings from GCC 7 2017-05-16 08:52:39 -04:00
pg_basebackup Address set of issues with errno handling 2018-06-25 11:20:50 +09:00
pg_config Translation updates 2018-02-05 12:38:16 -05:00
pg_controldata Translation updates 2018-02-05 12:38:16 -05:00
pg_ctl Translation updates 2018-02-05 12:38:16 -05:00
pg_dump Translation updates 2018-05-07 11:59:47 -04:00
pg_resetxlog Translation updates 2018-02-05 12:38:16 -05:00
pg_rewind Translation updates 2018-05-07 11:59:47 -04:00
pg_test_fsync Avoid depending on non-POSIX behavior of fcntl(2). 2017-04-21 15:55:56 -04:00
pg_test_timing Move pg_test_timing from contrib/ to src/bin/ 2015-04-20 21:30:12 -04:00
pg_upgrade Allow MSYS as well as MINGW in Msys uname 2018-05-04 15:01:57 -04:00
pg_xlogdump Use snprintf not sprintf in pg_waldump's timestamptz_to_str. 2018-06-16 14:45:47 -04:00
pgbench Fix broken link-command-line ordering for libpgfeutils. 2017-07-14 12:26:53 -04:00
pgevent Update copyright for 2016 2016-01-02 13:33:40 -05:00
psql Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
scripts Improve inefficient regexes in vacuumdb TAP test. 2018-05-08 20:17:43 -04:00
Makefile Update copyright for 2016 2016-01-02 13:33:40 -05:00