mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
Ensure errno is valid when returning from lxcContainerWaitForContinue
Only some of the return paths of lxcContainerWaitForContinue will have set errno. In other paths we need to set it manually to avoid the caller getting a random stale errno value * src/lxc/lxc_container.c: Set errno in lxcContainerWaitForContinue
This commit is contained in:
parent
f33b5792f7
commit
065ecf5162
@ -224,8 +224,13 @@ int lxcContainerWaitForContinue(int control)
|
||||
int readLen;
|
||||
|
||||
readLen = saferead(control, &msg, sizeof(msg));
|
||||
if (readLen != sizeof(msg) ||
|
||||
msg != LXC_CONTINUE_MSG) {
|
||||
if (readLen != sizeof(msg)) {
|
||||
if (readLen >= 0)
|
||||
errno = EIO;
|
||||
return -1;
|
||||
}
|
||||
if (msg != LXC_CONTINUE_MSG) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user