Re: [PATCH v2 08/21] bisect: report on fopen() error
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 3, 2017, 15:12 UTC
- Message-ID
- <alpine.DEB.2.20.1705031710500.3480@virtualbox>
- In-Reply-To
- <20170503101706.9223-9-pclouds@gmail.com>
Hi Duy,
On Wed, 3 May 2017, Nguyễn Thái Ngọc Duy wrote:
Show 10 quoted lines
> The main thing to catch here is when fopen() is called on a > directory. It's safe even without this change because a few lines > earlier we do check if "filename" is a regular file. > > Regardless, let's stay on the safe side in case somebody changes those > lines. Unconditionally printing to stderr by warn_on_inaccessible() > should be fine, because the caller does unconditional fprintf(stderr, > too, no checking for quiet option or anything. > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
I appreciate that you mention specifically the use case that triggered my complaint that in turn prodded you into starting working on this.
However, I think this should be a mere side note in a single commit that introduces and uses fopen_or_warn().
Ciao, Dscho