Bug fixes
This commit is contained in:
+1
-1
@@ -587,7 +587,7 @@ static int setup_poll_array(void **contexts, struct pollfd *polled)
|
|||||||
switch (desc->type) {
|
switch (desc->type) {
|
||||||
|
|
||||||
case DESC_FILE:
|
case DESC_FILE:
|
||||||
assert(0); // TODO: error
|
// Ignore
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DESC_SOCKET:
|
case DESC_SOCKET:
|
||||||
|
|||||||
@@ -87,8 +87,10 @@ deserialize_callback(char *dst, int num, void *data)
|
|||||||
int copied = 0;
|
int copied = 0;
|
||||||
while (copied < num) {
|
while (copied < num) {
|
||||||
int ret = file_read(rsc->handle, dst + copied, num - copied);
|
int ret = file_read(rsc->handle, dst + copied, num - copied);
|
||||||
if (ret <= 0)
|
if (ret < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
if (ret == 0)
|
||||||
|
break;
|
||||||
copied += ret;
|
copied += ret;
|
||||||
}
|
}
|
||||||
return copied;
|
return copied;
|
||||||
|
|||||||
Reference in New Issue
Block a user