[Spice-devel] [PATCH spice 04/12] Mark functions which never return control

Daniel P. Berrange berrange at redhat.com
Mon Apr 2 04:23:39 PDT 2012


From: "Daniel P. Berrange" <berrange at redhat.com>

* client/red_channel.cpp:  AbortTrigger::on_event can't return
  given its current impl
* server/red_worker.c: red_worker_main can't return

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 client/red_channel.cpp |    2 +-
 server/red_worker.c    |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/client/red_channel.cpp b/client/red_channel.cpp
index 5523abd..f585732 100644
--- a/client/red_channel.cpp
+++ b/client/red_channel.cpp
@@ -322,7 +322,7 @@ void SendTrigger::on_event()
     _channel.on_send_trigger();
 }
 
-void AbortTrigger::on_event()
+SPICE_GNUC_NORETURN void AbortTrigger::on_event()
 {
     THROW("abort");
 }
diff --git a/server/red_worker.c b/server/red_worker.c
index bd58f96..c23bd35 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -11113,7 +11113,7 @@ static void red_display_cc_free_glz_drawables(RedChannelClient *rcc)
     red_display_handle_glz_drawables_to_free(dcc);
 }
 
-void *red_worker_main(void *arg)
+SPICE_GNUC_NORETURN void *red_worker_main(void *arg)
 {
     RedWorker worker;
 
@@ -11187,8 +11187,7 @@ void *red_worker_main(void *arg)
         }
         red_push(&worker);
     }
-    spice_printerr("exit");
-    return 0;
+    abort();
 }
 
 #ifdef DUMP_BITMAP
-- 
1.7.7.6



More information about the Spice-devel mailing list