diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2015-11-06 14:13:53 +0000 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2015-11-09 10:25:32 +0000 |
commit | cd15fcb6278138be9505814e09cd78bac1e6b4bb (patch) | |
tree | 883a0e8abc7ca7cddda165ad168542a103f0b472 /server/dispatcher.c | |
parent | 452edd8f7aa25fc1e69b6c2a747f59f58ab07f32 (diff) |
dispatcher: remove receive_data and send_data functions
Use read_safe/write_safe instead which do the same stuff
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'server/dispatcher.c')
-rw-r--r-- | server/dispatcher.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/dispatcher.c b/server/dispatcher.c index d334117f..945edba5 100644 --- a/server/dispatcher.c +++ b/server/dispatcher.c @@ -32,7 +32,6 @@ #include "common/mem.h" #include "common/spice_common.h" #include "dispatcher.h" -#include "red_dispatcher.h" //#define DEBUG_DISPATCHER @@ -203,12 +202,13 @@ unlock: uint32_t dispatcher_read_message(Dispatcher *dispatcher) { - uint32_t message; + uint32_t message = 0; spice_return_val_if_fail(dispatcher, 0); spice_return_val_if_fail(dispatcher->send_fd != -1, 0); - receive_data(dispatcher->send_fd, &message, sizeof(message)); + if (read_safe(dispatcher->send_fd, (uint8_t*)&message, sizeof(message), 1) == -1) + spice_warn_if_reached(); return message; } |