[tuxdroid-svn] r442 - daemon/trunk/libs
Status: Beta
Brought to you by:
ks156
From: neimad <c2m...@c2...> - 2007-06-24 16:28:02
|
Author: neimad Date: 2007-06-24 18:28:00 +0200 (Sun, 24 Jun 2007) New Revision: 442 Modified: daemon/trunk/libs/USBDaemon_command_tux.c Log: * Several checks in tux_connection() tested >= 0 while the functions checked only return <= 0 (0 meaning success). Changed these checks to test == 0. Modified: daemon/trunk/libs/USBDaemon_command_tux.c =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.c 2007-06-24 16:19:37 UTC (rev 441) +++ daemon/trunk/libs/USBDaemon_command_tux.c 2007-06-24 16:28:00 UTC (rev 442) @@ -256,9 +256,7 @@ tcp_server_send_raw_to_client(client_id, ack_dp_frame); /* Send tcp frame to client */ if (ACK_DP == ACK_DP_OK) - { tcp_server_send_raw_to_client(client_id, tcp_frame); - } } } @@ -650,7 +648,7 @@ switch (data[0]) { case TUX_CONNECTION_DISCONNECT: - if (disconnect_from_tux() >= 0) + if (disconnect_from_tux() == 0) result[1] = TUX_CONNECTION_ACK; else result[1] = TUX_CONNECTION_NACK; @@ -660,7 +658,7 @@ union_uint16_t id; id.b[1] = data[1]; id.b[0] = data[2]; - if (connect_to_tux(id.w) >= 0) + if (connect_to_tux(id.w) == 0) result[1] = TUX_CONNECTION_ACK; else result[1] = TUX_CONNECTION_NACK; @@ -669,7 +667,7 @@ case TUX_CONNECTION_ID_REQUEST: { union_uint16_t id; - if (id_request((uint16_t *)&id) >= 0) + if (id_request((uint16_t *)&id) == 0) { result[1] = TUX_CONNECTION_ACK; result[2] = id.b[1]; /* MSB */ @@ -682,7 +680,7 @@ case TUX_CONNECTION_ID_LOOKUP: { union_uint16_t id; - if (id_lookup((uint16_t *)&id) >= 0) + if (id_lookup((uint16_t *)&id) == 0) { result[1] = TUX_CONNECTION_ACK; result[2] = id.b[1]; /* MSB */ @@ -714,14 +712,14 @@ union_uint16_t id; id.b[0] = data[2]; /* LSB */ id.b[1] = data[1]; /* MSB */ - if (wakeup_tux(id.w) >= 0) + if (wakeup_tux(id.w) == 0) result[1] = TUX_CONNECTION_ACK; else result[1] = TUX_CONNECTION_NACK; } break; case TUX_CONNECTION_RANDOM: - if (random_tux_connection() >= 0) + if (random_tux_connection() == 0) result[1] = TUX_CONNECTION_ACK; else result[1] = TUX_CONNECTION_NACK; |