Fix type for assignment
The functions net_send_all() and net_recv_all() return ssize_t, not int.
This commit is contained in:
parent
6f03022646
commit
f78608ab29
2 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ process_msg(struct controller *controller,
|
||||||
if (!length) {
|
if (!length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int w = net_send_all(controller->control_socket, serialized_msg, length);
|
ssize_t w = net_send_all(controller->control_socket, serialized_msg, length);
|
||||||
return (size_t) w == length;
|
return (size_t) w == length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -470,7 +470,7 @@ error:
|
||||||
static bool
|
static bool
|
||||||
device_read_info(socket_t device_socket, char *device_name, struct size *size) {
|
device_read_info(socket_t device_socket, char *device_name, struct size *size) {
|
||||||
unsigned char buf[DEVICE_NAME_FIELD_LENGTH + 4];
|
unsigned char buf[DEVICE_NAME_FIELD_LENGTH + 4];
|
||||||
int r = net_recv_all(device_socket, buf, sizeof(buf));
|
ssize_t r = net_recv_all(device_socket, buf, sizeof(buf));
|
||||||
if (r < DEVICE_NAME_FIELD_LENGTH + 4) {
|
if (r < DEVICE_NAME_FIELD_LENGTH + 4) {
|
||||||
LOGE("Could not retrieve device information");
|
LOGE("Could not retrieve device information");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue