[PATCH 2/7] reds_init_net: report errors on watch setup failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We used to be aborting in such situations, but this was changed
during the big spice_error/printerr cleanup. We are currently
outputting a warning but not reporting the error with the caller
when reds_init_net fails to register listening watches with the
mainloop. As it's unlikely that things will work as expected in
such cases, better to error out of the function instead of pretending
everything is all right.
---
 server/reds.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/reds.c b/server/reds.c
index 993a132..202d9c3 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3128,6 +3128,7 @@ static int reds_init_net(void)
                                              reds_accept, NULL);
         if (reds->listen_watch == NULL) {
             spice_warning("set fd handle failed");
+            return -1;
         }
     }
 
@@ -3142,6 +3143,7 @@ static int reds_init_net(void)
                                                     reds_accept_ssl_connection, NULL);
         if (reds->secure_listen_watch == NULL) {
             spice_warning("set fd handle failed");
+            return -1;
         }
     }
 
@@ -3152,6 +3154,7 @@ static int reds_init_net(void)
                                              reds_accept, NULL);
         if (reds->listen_watch == NULL) {
             spice_warning("set fd handle failed");
+            return -1;
         }
     }
     return 0;
-- 
1.7.11.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]