mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
lxc: Fix coverity findings
Error: UNINIT: /libvirt/src/lxc/lxc_driver.c:1412: var_decl: Declaring variable "fd" without initializer. /libvirt/src/lxc/lxc_driver.c:1460: uninit_use_in_call: Using uninitialized value "fd" when calling "virFileClose". /libvirt/src/util/virfile.c:50: read_parm: Reading a parameter value. Error: DEADCODE: /libvirt/src/lxc/lxc_controller.c:960: dead_error_condition: On this path, the condition "ret == 4" cannot be true. /libvirt/src/lxc/lxc_controller.c:959: at_most: After this line, the value of "ret" is at most -1. /libvirt/src/lxc/lxc_controller.c:959: new_values: Noticing condition "ret < 0". /libvirt/src/lxc/lxc_controller.c:961: dead_error_line: Execution cannot reach this statement "continue;". Error: UNINIT: /libvirt/src/lxc/lxc_controller.c:1104: var_decl: Declaring variable "consoles" without initializer. /libvirt/src/lxc/lxc_controller.c:1237: uninit_use: Using uninitialized value "consoles".
This commit is contained in:
parent
002b18b3fb
commit
f74471de4f
@ -957,7 +957,7 @@ static void lxcEpollIO(int watch, int fd, int events, void *opaque)
|
||||
int ret;
|
||||
ret = epoll_wait(console->epollFd, &event, 1, 0);
|
||||
if (ret < 0) {
|
||||
if (ret == EINTR)
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
virReportSystemError(errno, "%s",
|
||||
_("Unable to wait on epoll"));
|
||||
@ -1101,7 +1101,7 @@ static int lxcControllerMain(int serverFd,
|
||||
size_t nFds,
|
||||
pid_t container)
|
||||
{
|
||||
struct lxcConsole *consoles;
|
||||
struct lxcConsole *consoles = NULL;
|
||||
struct lxcMonitor monitor = {
|
||||
.serverFd = serverFd,
|
||||
.clientFd = clientFd,
|
||||
|
@ -1409,7 +1409,7 @@ static int lxcMonitorClient(lxc_driver_t * driver,
|
||||
virDomainObjPtr vm)
|
||||
{
|
||||
char *sockpath = NULL;
|
||||
int fd;
|
||||
int fd = -1;
|
||||
struct sockaddr_un addr;
|
||||
|
||||
if (virAsprintf(&sockpath, "%s/%s.sock",
|
||||
|
Loading…
Reference in New Issue
Block a user