Unverified Commit aa4376ad by tomponline Committed by Christian Brauner

lxccontainer: shut up gcc and remove unused variables.

Closes #2885. Signed-off-by: 's avatartomponline <tomp@tomp.uk>
parent 32dad1cd
...@@ -118,7 +118,7 @@ static bool do_lxcapi_save_config(struct lxc_container *c, const char *alt_file) ...@@ -118,7 +118,7 @@ static bool do_lxcapi_save_config(struct lxc_container *c, const char *alt_file)
static bool config_file_exists(const char *lxcpath, const char *cname) static bool config_file_exists(const char *lxcpath, const char *cname)
{ {
__do_free char *fname; __do_free char *fname = NULL;
int ret; int ret;
size_t len; size_t len;
...@@ -142,7 +142,7 @@ static bool config_file_exists(const char *lxcpath, const char *cname) ...@@ -142,7 +142,7 @@ static bool config_file_exists(const char *lxcpath, const char *cname)
*/ */
static int ongoing_create(struct lxc_container *c) static int ongoing_create(struct lxc_container *c)
{ {
__do_free char *path; __do_free char *path = NULL;
int fd, ret; int fd, ret;
size_t len; size_t len;
struct flock lk = {0}; struct flock lk = {0};
...@@ -188,7 +188,7 @@ static int ongoing_create(struct lxc_container *c) ...@@ -188,7 +188,7 @@ static int ongoing_create(struct lxc_container *c)
static int create_partial(struct lxc_container *c) static int create_partial(struct lxc_container *c)
{ {
__do_free char *path; __do_free char *path = NULL;
int fd, ret; int fd, ret;
size_t len; size_t len;
struct flock lk = {0}; struct flock lk = {0};
...@@ -225,7 +225,7 @@ static int create_partial(struct lxc_container *c) ...@@ -225,7 +225,7 @@ static int create_partial(struct lxc_container *c)
static void remove_partial(struct lxc_container *c, int fd) static void remove_partial(struct lxc_container *c, int fd)
{ {
__do_free char *path; __do_free char *path = NULL;
int ret; int ret;
size_t len; size_t len;
...@@ -1184,7 +1184,6 @@ static int do_create_container_dir(const char *path, struct lxc_conf *conf) ...@@ -1184,7 +1184,6 @@ static int do_create_container_dir(const char *path, struct lxc_conf *conf)
{ {
__do_free char *p = NULL; __do_free char *p = NULL;
int lasterr; int lasterr;
size_t len;
int ret = -1; int ret = -1;
mode_t mask = umask(0002); mode_t mask = umask(0002);
...@@ -1241,7 +1240,7 @@ static struct lxc_storage *do_storage_create(struct lxc_container *c, ...@@ -1241,7 +1240,7 @@ static struct lxc_storage *do_storage_create(struct lxc_container *c,
const char *type, const char *type,
struct bdev_specs *specs) struct bdev_specs *specs)
{ {
__do_free char *dest; __do_free char *dest = NULL;
int ret; int ret;
size_t len; size_t len;
struct lxc_storage *bdev; struct lxc_storage *bdev;
...@@ -3358,7 +3357,7 @@ err: ...@@ -3358,7 +3357,7 @@ err:
static int copyhooks(struct lxc_container *oldc, struct lxc_container *c) static int copyhooks(struct lxc_container *oldc, struct lxc_container *c)
{ {
__do_free char *cpath; __do_free char *cpath = NULL;
int i, len, ret; int i, len, ret;
struct lxc_list *it; struct lxc_list *it;
...@@ -3521,7 +3520,7 @@ static bool add_rdepends(struct lxc_container *c, struct lxc_container *c0) ...@@ -3521,7 +3520,7 @@ static bool add_rdepends(struct lxc_container *c, struct lxc_container *c0)
bool should_default_to_snapshot(struct lxc_container *c0, bool should_default_to_snapshot(struct lxc_container *c0,
struct lxc_container *c1) struct lxc_container *c1)
{ {
__do_free char *p0, *p1; __do_free char *p0 = NULL, *p1 = NULL;
int ret; int ret;
size_t l0 = strlen(c0->config_path) + strlen(c0->name) + 2; size_t l0 = strlen(c0->config_path) + strlen(c0->name) + 2;
size_t l1 = strlen(c1->config_path) + strlen(c1->name) + 2; size_t l1 = strlen(c1->config_path) + strlen(c1->name) + 2;
...@@ -4051,7 +4050,7 @@ static int lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options_t ...@@ -4051,7 +4050,7 @@ static int lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options_t
static int get_next_index(const char *lxcpath, char *cname) static int get_next_index(const char *lxcpath, char *cname)
{ {
__do_free char *fname; __do_free char *fname = NULL;
struct stat sb; struct stat sb;
int i = 0, ret; int i = 0, ret;
...@@ -4186,7 +4185,7 @@ static int do_lxcapi_snapshot(struct lxc_container *c, const char *commentfile) ...@@ -4186,7 +4185,7 @@ static int do_lxcapi_snapshot(struct lxc_container *c, const char *commentfile)
} }
if (commentfile) { if (commentfile) {
__do_free char *path; __do_free char *path = NULL;
/* $p / $name / comment \0 */ /* $p / $name / comment \0 */
int len = strlen(snappath) + strlen(newname) + 10; int len = strlen(snappath) + strlen(newname) + 10;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment