On 7/22/20 11:44 PM, Stefan Berger wrote: > On 7/22/20 7:23 AM, Philippe Mathieu-Daudé wrote: >> When an incorrect backend is selected, tpm_display_backend_drivers() >> is supposed to list the available backends. However the error is >> directly propagated, and we never display the list. The user only >> gets "Parameter 'type' expects a TPM backend type" error. >> >> Convert the fprintf(stderr,) calls to error hints propagated with >> the error. >> >> Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> >> --- >> RFC because this is now odd in tpm_config_parse(): > > because it's not using the fprintf anymore ? > >
Because when using &error_fatal you don't return: if (!strcmp(optarg, "help")) { tpm_list_backend_drivers_hint(&error_fatal); /* not reached */ return -1; } I should probably use that instead: if (!strcmp(optarg, "help")) { tpm_list_backend_drivers_hint(&error_fatal); g_assert_not_reached(); }