summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-09-11 18:07:06 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2012-09-20 16:40:54 +0200
commit5177c5fd09dc7bc9e237b8d0738d9bb4218706e0 (patch)
tree31ba3455407097d3bf733f797434c096efbfaa65
parenteb19ac081f66d72f88868bb977c2b7e4a2b0259b (diff)
downloadspice-5177c5fd09dc7bc9e237b8d0738d9bb4218706e0.tar.gz
spice-5177c5fd09dc7bc9e237b8d0738d9bb4218706e0.tar.xz
spice-5177c5fd09dc7bc9e237b8d0738d9bb4218706e0.zip
reds_init_net: report errors on watch setup failures
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.
-rw-r--r--server/reds.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/reds.c b/server/reds.c
index 4dd713e0..7108c1be 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3176,6 +3176,7 @@ static int reds_init_net(void)
reds_accept, NULL);
if (reds->listen_watch == NULL) {
spice_warning("set fd handle failed");
+ return -1;
}
}
@@ -3190,6 +3191,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;
}
}
@@ -3200,6 +3202,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;