]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tools: lxc-unshare: fix wrong coding rules
author2xsec <dh48.jeong@samsung.com>
Sat, 14 Jul 2018 13:07:59 +0000 (22:07 +0900)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 24 Jul 2018 12:59:03 +0000 (14:59 +0200)
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/tools/arguments.c
src/lxc/tools/lxc_unshare.c

index 30bb5dbb255edd029416c7588ee5b7f94af6ca40..89af23c7f18653c83927e0087405127bc85aff61 100644 (file)
@@ -338,4 +338,4 @@ bool lxc_setup_shared_ns(struct lxc_arguments *args, struct lxc_container *c)
        }
 
        return true;
-}
\ No newline at end of file
+}
index c1ec99611c85054c13c6cae82b636b0bc38206d7..501698c80c242e7a9c38b024e5bd32d667fab425 100644 (file)
@@ -71,7 +71,7 @@ static int mount_fs(const char *source, const char *target, const char *type);
 static void lxc_setup_fs(void);
 static int do_start(void *arg);
 
-static struct my_iflist *tmpif, *my_iflist = NULL;
+static struct my_iflist *tmpif, *my_iflist;
 
 static const struct option my_longopts[] = {
        {"namespaces", required_argument, 0, 's'},
@@ -128,7 +128,8 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
                args->want_hostname = arg;
                break;
        case 'i':
-               if (!(tmpif = malloc(sizeof(*tmpif)))) {
+               tmpif = malloc(sizeof(*tmpif));
+               if (!tmpif) {
                        SYSERROR("Failed to malloc()");
                        return -1;
                }
@@ -327,7 +328,7 @@ int main(int argc, char *argv[])
                        exit(EXIT_FAILURE);
        }
 
-       if (*my_args.argv == NULL) {
+       if (!*my_args.argv) {
                ERROR("A command to execute in the new namespace is required");
                exit(EXIT_FAILURE);
        }
@@ -443,4 +444,4 @@ int main(int argc, char *argv[])
 
        /* Call exit() directly on this function because it retuns an exit code. */
        exit(EXIT_SUCCESS);
-}
\ No newline at end of file
+}