Re: [PATCH v2 20/21] config.c: handle error on failing to fopen()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 3, 2017, 15:29 UTC
- Message-ID
- <alpine.DEB.2.20.1705031727410.3480@virtualbox>
- In-Reply-To
- <20170503101706.9223-21-pclouds@gmail.com>
Hi Duy,
On Wed, 3 May 2017, Nguyễn Thái Ngọc Duy wrote:
Show 7 quoted lines
> In the first case, we already correctly return -1 if fopen() fails to > open. But we should report something so people know what's wrong. > > In the second case, config_file == NULL does not necessarily mean "no > config file". Bail out if needed. > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Again, it seems that your patch series tries to cut at the file boundary, not at the "logically the same change" boundary, making it a bit more cumbersome than necessary to follow this patch series.
I highly recommend squashing the first change into the big fopen() -> fopen_or_warn() patch I hinted at earlier, and let the second change (with the accompanying test case) stand on its own.
Ciao, Dscho