]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fortify: minor cleanups for unused variables, stricter types
authorDwight Engen <dwight.engen@oracle.com>
Mon, 15 Apr 2013 19:59:12 +0000 (15:59 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 16 Apr 2013 10:15:56 +0000 (12:15 +0200)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/log.c
src/lxc/log.h
src/lxc/lxccontainer.c
src/lxc/network.c
src/lxc/state.c

index 68a181c3a043390f2b141d32c58102ba45239c90..3c6e4d1884c66ed3348372e0423d0721174d0c77 100644 (file)
@@ -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;
        }
 
index 4252fa17fdc7cbbe0a5f5f1910950efce51c02e3..cd43068a80e8acfdb3795ba9fc4355f3d0c2f8a4 100644 (file)
@@ -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)                   \
                                                                        \
index ce751ea417b68a8c466a55b4ce1a83ebc4f07227..1df6a9817383bf89713a9782855a653869c51e5f 100644 (file)
@@ -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);
        }
index 3829757ecdeb3b424ffc45b18f6dfa8af376ad4c..93fc169c24231999863a774717891ce5974dcc18 100644 (file)
@@ -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
index 3e7e94afbe9407d178ac7dc859e30981a7959345..437f11aa66a0c995e1c15516ad45758058629aed 100644 (file)
@@ -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;