In serial mode, return failure if the other end closes the connection
before we see SERIAL_MAGIC in the reply or timeout. Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
This commit is contained in:
parent
2f87331c1a
commit
52381ce2b7
@ -283,6 +283,9 @@ serial_fence_virt(fence_virt_args_t *args)
|
|||||||
if (wait_for(fd, (const char *)&resp.magic,
|
if (wait_for(fd, (const char *)&resp.magic,
|
||||||
sizeof(resp.magic), &tv) == 0) {
|
sizeof(resp.magic), &tv) == 0) {
|
||||||
ret = _read_retry(fd, &resp.response, sizeof(resp.response), &tv);
|
ret = _read_retry(fd, &resp.response, sizeof(resp.response), &tv);
|
||||||
|
} else {
|
||||||
|
/* The other end died or closed the connection */
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
swab_serial_resp_t(&resp);
|
swab_serial_resp_t(&resp);
|
||||||
|
Loading…
Reference in New Issue
Block a user