[lxc-devel] [PATCH] fortify: minor cleanups for unused variables, stricter types
Serge Hallyn
serge.hallyn at ubuntu.com
Tue Apr 16 02:37:11 UTC 2013
Quoting Dwight Engen (dwight.engen at oracle.com):
> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> src/lxc/log.c | 1 -
> src/lxc/log.h | 2 +-
> src/lxc/lxccontainer.c | 4 ++--
> src/lxc/network.c | 1 -
> src/lxc/state.c | 7 ++++---
> 5 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/src/lxc/log.c b/src/lxc/log.c
> index 68a181c..3c6e4d1 100644
> --- a/src/lxc/log.c
> +++ b/src/lxc/log.c
> @@ -244,7 +244,6 @@ extern int lxc_log_init(const char *name, const char *file,
> lxc_log_setprefix(prefix);
>
> if (file && strcmp(file, "none") == 0) {
> - want_lxc_log_specified = 1;
> return 0;
> }
>
> diff --git a/src/lxc/log.h b/src/lxc/log.h
> index 4252fa1..cd43068 100644
> --- a/src/lxc/log.h
> +++ b/src/lxc/log.h
> @@ -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) \
> \
> diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
> index ce751ea..1df6a98 100644
> --- a/src/lxc/lxccontainer.c
> +++ b/src/lxc/lxccontainer.c
> @@ -630,7 +630,7 @@ static bool lxcapi_create(struct lxc_container *c, char *t, char *const argv[])
> newargv[nargs - 1] = NULL;
>
> /* execute */
> - ret = execv(tpath, newargv);
> + execv(tpath, newargv);
> SYSERROR("failed to execute template %s", tpath);
> exit(1);
> }
> @@ -833,7 +833,7 @@ static bool lxcapi_destroy(struct lxc_container *c)
> if (pid < 0)
> return false;
> 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");
> exit(1);
> }
> diff --git a/src/lxc/network.c b/src/lxc/network.c
> index 3829757..93fc169 100644
> --- a/src/lxc/network.c
> +++ b/src/lxc/network.c
> @@ -836,7 +836,6 @@ static int ip_addr_get(int family, int ifindex, void **res)
> err = netlink_send(&nlh, nlmsg);
> if (err < 0)
> goto out;
> - err = 0;
>
> do {
> /* Restore the answer buffer length, it might have been
> diff --git a/src/lxc/state.c b/src/lxc/state.c
> index 3e7e94a..437f11a 100644
> --- a/src/lxc/state.c
> +++ b/src/lxc/state.c
> @@ -56,7 +56,8 @@ const char *lxc_state2str(lxc_state_t 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]);
> for (i = 0; i < len; i++)
> if (!strcmp(strstate[i], state))
> @@ -66,7 +67,7 @@ lxc_state_t lxc_str2state(const char *state)
> 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 freezer[MAXPATHLEN];
> @@ -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)
> {
> - int state = freezer_state(name, lxcpath);
> + lxc_state_t state = freezer_state(name, lxcpath);
> if (state != FROZEN && state != FREEZING)
> state = __lxc_getstate(name, lxcpath);
> return state;
> --
> 1.7.12.3
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list