Fix for pg_upgrade discriptor leaks

Started by Bruce Momjianabout 15 years ago3 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

I have applied the attached patch to fix pg_upgrade file descriptor
leaks in error paths.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachments:

/rtmp/pg_upgrade.difftext/x-diffDownload+38-21
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: Fix for pg_upgrade discriptor leaks

Bruce Momjian <bruce@momjian.us> writes:

I have applied the attached patch to fix pg_upgrade file descriptor
leaks in error paths.

It seems rather pointless to spend code closing descriptors immediately
before a fatal exit.

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: Fix for pg_upgrade discriptor leaks

Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

I have applied the attached patch to fix pg_upgrade file descriptor
leaks in error paths.

It seems rather pointless to spend code closing descriptors immediately
before a fatal exit.

Well, it is not before a fatal but rather before it returns -1, which
might fatal or might not. I also had code in to close file descriptors
that was a little too tricky about using a single variable to indicate
two things so I cleaned it up. I got a private email report about these
so obviously they were confusing.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +