From f9734d5d4078f17daf328b9e113aaffe3d00ecaf Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 20 Jul 2021 14:53:53 +0200 Subject: error: Use error_fatal to simplify obvious fatal errors (again) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We did this with scripts/coccinelle/use-error_fatal.cocci before, in commit 50beeb68094 and 007b06578ab. This commit cleans up rarer variations that don't seem worth matching with Coccinelle. Cc: Thomas Huth Cc: Cornelia Huck Cc: Peter Xu Cc: Juan Quintela Cc: Stefan Hajnoczi Cc: Paolo Bonzini Cc: Marc-André Lureau Cc: Gerd Hoffmann Cc: Daniel P. Berrangé Signed-off-by: Markus Armbruster Message-Id: <20210720125408.387910-2-armbru@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Peter Xu Acked-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé --- scsi/qemu-pr-helper.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'scsi') diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 7b9389b47b..f281daeced 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -1044,10 +1044,7 @@ int main(int argc, char **argv) } } - if (qemu_init_main_loop(&local_err)) { - error_report_err(local_err); - exit(EXIT_FAILURE); - } + qemu_init_main_loop(&error_fatal); server_watch = qio_channel_add_watch(QIO_CHANNEL(server_ioc), G_IO_IN, @@ -1061,10 +1058,8 @@ int main(int argc, char **argv) } } - if ((daemonize || pidfile_specified) && - !qemu_write_pidfile(pidfile, &local_err)) { - error_report_err(local_err); - exit(EXIT_FAILURE); + if (daemonize || pidfile_specified) { + qemu_write_pidfile(pidfile, &error_fatal); } #ifdef CONFIG_LIBCAP_NG -- cgit v1.2.3