Re: Should program exit, When close() failed for O_RDONLY mode

2020-05-03 Thread Michael Paquier
On Sun, May 03, 2020 at 10:18:27AM -0700, Noah Misch wrote: > I would not say that. If close() does fail, something is badly wrong in the > program or the system running it. Though I opt not to check the return value, > if one does check it, exiting is a suitable response. FWIW, it seems to me t

Re: Should program exit, When close() failed for O_RDONLY mode

2020-05-03 Thread Noah Misch
On Tue, Apr 14, 2020 at 02:32:40AM +, Lin, Cuiping wrote: > I find that most of the code does not check the return value of close(), > When open a file for reading(O_RDONLY). > > But I find that it checks the return value of close() in code > "src/bin/pg_rewind/copy_fetch.c" When open a f

Should program exit, When close() failed for O_RDONLY mode

2020-04-13 Thread Lin, Cuiping
Hi, I find that most of the code does not check the return value of close(), When open a file for reading(O_RDONLY). But I find that it checks the return value of close() in code "src/bin/pg_rewind/copy_fetch.c" When open a file for reading(O_RDONLY). And it will call pg_fatal to cause pre