lxccontainer: satisfy coverity

The container name can't be NULL so don't give coverity the impression that it
could be.

Silences coverity #1426123.
Silences coverity #1426124.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-02-08 15:57:02 +01:00
parent 341ed84c47
commit cb8ff4d033
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -2727,7 +2727,7 @@ static bool container_destroy(struct lxc_container *c,
if (conf && !lxc_list_empty(&conf->hooks[LXCHOOK_DESTROY])) {
/* Start of environment variable setup for hooks */
if (c->name && setenv("LXC_NAME", c->name, 1))
if (setenv("LXC_NAME", c->name, 1))
SYSERROR("Failed to set environment variable for container name");
if (conf->rcfile && setenv("LXC_CONFIG_FILE", conf->rcfile, 1))
@ -3425,7 +3425,7 @@ static int clone_update_rootfs(struct clone_update_data *data)
if (c0->name && setenv("LXC_SRC_NAME", c0->name, 1)) {
SYSERROR("failed to set environment variable for source container name");
}
if (c->name && setenv("LXC_NAME", c->name, 1)) {
if (setenv("LXC_NAME", c->name, 1)) {
SYSERROR("failed to set environment variable for container name");
}
if (conf->rcfile && setenv("LXC_CONFIG_FILE", conf->rcfile, 1)) {