The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2382

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Hello,

some deadcodes were removed.

Thanks.
From f2d6d60a183e551a6c3e4cf2d7f11455a9b17026 Mon Sep 17 00:00:00 2001
From: Donghwa Jeong <[email protected]>
Date: Thu, 7 Jun 2018 11:09:25 +0900
Subject: [PATCH 1/2] coverity: remove deadcode

Signed-off-by: Donghwa Jeong <[email protected]>
---
 src/lxc/confile.c      | 2 --
 src/lxc/lxccontainer.c | 9 ---------
 src/lxc/pam/pam_cgfs.c | 3 ---
 src/lxc/utils.c        | 6 ------
 4 files changed, 20 deletions(-)
 mode change 100644 => 100755 src/lxc/confile.c
 mode change 100644 => 100755 src/lxc/lxccontainer.c
 mode change 100644 => 100755 src/lxc/pam/pam_cgfs.c
 mode change 100644 => 100755 src/lxc/utils.c

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
old mode 100644
new mode 100755
index 558e32e8c..d07ada29c
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -2076,8 +2076,6 @@ static int do_includedir(const char *dirp, struct 
lxc_conf *lxc_conf)
 
        while ((direntp = readdir(dir))) {
                const char *fnam;
-               if (!direntp)
-                       break;
 
                fnam = direntp->d_name;
                if (!strcmp(fnam, "."))
diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
old mode 100644
new mode 100755
index 04a6050f1..1196656b2
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -2777,9 +2777,6 @@ static bool has_snapshots(struct lxc_container *c)
        if (!dir)
                return false;
        while ((direntp = readdir(dir))) {
-               if (!direntp)
-                       break;
-
                if (!strcmp(direntp->d_name, "."))
                        continue;
 
@@ -4119,9 +4116,6 @@ static int do_lxcapi_snapshot_list(struct lxc_container 
*c, struct lxc_snapshot
        }
 
        while ((direntp = readdir(dir))) {
-               if (!direntp)
-                       break;
-
                if (!strcmp(direntp->d_name, "."))
                        continue;
 
@@ -4907,9 +4901,6 @@ int list_defined_containers(const char *lxcpath, char 
***names, struct lxc_conta
                *names = NULL;
 
        while ((direntp = readdir(dir))) {
-               if (!direntp)
-                       break;
-
                /* Ignore '.', '..' and any hidden directory. */
                if (!strncmp(direntp->d_name, ".", 1))
                        continue;
diff --git a/src/lxc/pam/pam_cgfs.c b/src/lxc/pam/pam_cgfs.c
old mode 100644
new mode 100755
index 5c272b0e8..d5196f8a0
--- a/src/lxc/pam/pam_cgfs.c
+++ b/src/lxc/pam/pam_cgfs.c
@@ -525,9 +525,6 @@ static int recursive_rmdir(char *dirname)
                struct stat st;
                char *pathname;
 
-               if (!direntp)
-                       break;
-
                if (!strcmp(direntp->d_name, ".") ||
                    !strcmp(direntp->d_name, ".."))
                        continue;
diff --git a/src/lxc/utils.c b/src/lxc/utils.c
old mode 100644
new mode 100755
index cd5edd6ab..12f2cd449
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -85,9 +85,6 @@ static int _recursive_rmdir(const char *dirname, dev_t pdev,
                struct stat mystat;
                int rc;
 
-               if (!direntp)
-                       break;
-
                if (!strcmp(direntp->d_name, ".") ||
                    !strcmp(direntp->d_name, ".."))
                        continue;
@@ -2091,9 +2088,6 @@ static int lxc_get_unused_loop_dev_legacy(char *loop_name)
                return -1;
 
        while ((dp = readdir(dir))) {
-               if (!dp)
-                       break;
-
                if (strncmp(dp->d_name, "loop", 4) != 0)
                        continue;
 

From 886f46b926a3c08ba15d422f8e9edf11d23c6765 Mon Sep 17 00:00:00 2001
From: Donghwa Jeong <[email protected]>
Date: Thu, 7 Jun 2018 11:13:07 +0900
Subject: [PATCH 2/2] fix file modes

Signed-off-by: Donghwa Jeong <[email protected]>
---
 src/lxc/confile.c      | 0
 src/lxc/lxccontainer.c | 0
 src/lxc/pam/pam_cgfs.c | 0
 src/lxc/utils.c        | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 src/lxc/confile.c
 mode change 100755 => 100644 src/lxc/lxccontainer.c
 mode change 100755 => 100644 src/lxc/pam/pam_cgfs.c
 mode change 100755 => 100644 src/lxc/utils.c

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
old mode 100755
new mode 100644
diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
old mode 100755
new mode 100644
diff --git a/src/lxc/pam/pam_cgfs.c b/src/lxc/pam/pam_cgfs.c
old mode 100755
new mode 100644
diff --git a/src/lxc/utils.c b/src/lxc/utils.c
old mode 100755
new mode 100644
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to