Commit e6a19d26 by Dwight Engen Committed by Stéphane Graber

fortify: minor cleanups for unused variables, stricter types

parent 0a218854
...@@ -244,7 +244,6 @@ extern int lxc_log_init(const char *name, const char *file, ...@@ -244,7 +244,6 @@ extern int lxc_log_init(const char *name, const char *file,
lxc_log_setprefix(prefix); lxc_log_setprefix(prefix);
if (file && strcmp(file, "none") == 0) { if (file && strcmp(file, "none") == 0) {
want_lxc_log_specified = 1;
return 0; return 0;
} }
......
...@@ -172,7 +172,7 @@ __lxc_log(const struct lxc_log_category* category, ...@@ -172,7 +172,7 @@ __lxc_log(const struct lxc_log_category* category,
} }
/* /*
* Helper macro to define log fonctions. * Helper macro to define log functions.
*/ */
#define lxc_log_priority_define(acategory, PRIORITY) \ #define lxc_log_priority_define(acategory, PRIORITY) \
\ \
......
...@@ -630,7 +630,7 @@ static bool lxcapi_create(struct lxc_container *c, char *t, char *const argv[]) ...@@ -630,7 +630,7 @@ static bool lxcapi_create(struct lxc_container *c, char *t, char *const argv[])
newargv[nargs - 1] = NULL; newargv[nargs - 1] = NULL;
/* execute */ /* execute */
ret = execv(tpath, newargv); execv(tpath, newargv);
SYSERROR("failed to execute template %s", tpath); SYSERROR("failed to execute template %s", tpath);
exit(1); exit(1);
} }
...@@ -833,7 +833,7 @@ static bool lxcapi_destroy(struct lxc_container *c) ...@@ -833,7 +833,7 @@ static bool lxcapi_destroy(struct lxc_container *c)
if (pid < 0) if (pid < 0)
return false; return false;
if (pid == 0) { // child if (pid == 0) { // child
ret = execlp("lxc-destroy", "lxc-destroy", "-n", c->name, "-P", c->config_path, NULL); execlp("lxc-destroy", "lxc-destroy", "-n", c->name, "-P", c->config_path, NULL);
perror("execl"); perror("execl");
exit(1); exit(1);
} }
......
...@@ -836,7 +836,6 @@ static int ip_addr_get(int family, int ifindex, void **res) ...@@ -836,7 +836,6 @@ static int ip_addr_get(int family, int ifindex, void **res)
err = netlink_send(&nlh, nlmsg); err = netlink_send(&nlh, nlmsg);
if (err < 0) if (err < 0)
goto out; goto out;
err = 0;
do { do {
/* Restore the answer buffer length, it might have been /* Restore the answer buffer length, it might have been
......
...@@ -56,7 +56,8 @@ const char *lxc_state2str(lxc_state_t state) ...@@ -56,7 +56,8 @@ const char *lxc_state2str(lxc_state_t state)
lxc_state_t lxc_str2state(const char *state) lxc_state_t lxc_str2state(const char *state)
{ {
int i, len; size_t len;
lxc_state_t i;
len = sizeof(strstate)/sizeof(strstate[0]); len = sizeof(strstate)/sizeof(strstate[0]);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
if (!strcmp(strstate[i], state)) if (!strcmp(strstate[i], state))
...@@ -66,7 +67,7 @@ lxc_state_t lxc_str2state(const char *state) ...@@ -66,7 +67,7 @@ lxc_state_t lxc_str2state(const char *state)
return -1; return -1;
} }
static int freezer_state(const char *name, const char *lxcpath) static lxc_state_t freezer_state(const char *name, const char *lxcpath)
{ {
char *nsgroup; char *nsgroup;
char freezer[MAXPATHLEN]; char freezer[MAXPATHLEN];
...@@ -132,7 +133,7 @@ static lxc_state_t __lxc_getstate(const char *name, const char *lxcpath) ...@@ -132,7 +133,7 @@ static lxc_state_t __lxc_getstate(const char *name, const char *lxcpath)
lxc_state_t lxc_getstate(const char *name, const char *lxcpath) lxc_state_t lxc_getstate(const char *name, const char *lxcpath)
{ {
int state = freezer_state(name, lxcpath); lxc_state_t state = freezer_state(name, lxcpath);
if (state != FROZEN && state != FREEZING) if (state != FROZEN && state != FREEZING)
state = __lxc_getstate(name, lxcpath); state = __lxc_getstate(name, lxcpath);
return state; return state;
......
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