On Wed, 2022-11-02 at 17:02 -0400, Stefan Berger wrote: > > On 11/1/22 16:17, Mimi Zohar wrote: > > Define a log_errno_reset macro to emit the errno string at or near the > > time of error, similar to the existing log_errno macro, but also reset > > errno to avoid dangling or duplicate errno messages on exit. > > > > The initial usage is for non-critical file open failures. > > After looking just at the fopen() in evmctl.c at the end of this > series there are some that are left over that show no error message > (read_binary_bios_measurements) others that still use log_err() then. > Should they not all be converted/extended and use log_errno_reset()? > No, log_errno_reset() is meant for the specific case where the program continues to execute, but the errno message is delayed and emitted on program exit. In the case of read_binary_bios_measurements(), the caller emits an error message and immediately exits. There's no delay between the error and the errno message. Calling log_err() to emit an error mesage and then exiting seems to be fine. -- thanks, Mimi