Re: [PATCH 3/4] bisect: simplify the add of new bisect terms
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jun 10, 2015, 15:24 UTC
- Message-ID
- <vpq381zsi1w.fsf@anie.imag.fr>
- In-Reply-To
- <2070840481.381260.1433929304815.JavaMail.zimbra@ensimag.grenoble-inp.fr>
Louis-Alexandre Stuber <stuberl@ensimag.grenoble-inp.fr> writes:
Show 12 quoted lines
> But ENOENT is not a normal case at all. Should we not treat it the same
> way as other fopen() errors ? (either going on with default case or
> returning an error)
>
> Would :
>
>> if (!fp) {
>> die("could not read file '%s': %s",
>> filename, strerror(errno));
>> } else {
>
> be ok ?That would be much better than what we had in the patch, which did not look like an error at all:
+ FILE *fp = fopen(filename, "r"); + + if (!fp) { + name_bad = "bad"; + name_good = "good";
-- Matthieu Moy http://www-verimag.imag.fr/~moy/