Unverified Commit 7568a48f by Christian Brauner Committed by GitHub

Merge pull request #2383 from 2xsec/coverity

coverity: #1425849, #1425821, #1425794, #1425779, #1425777, #1425795, #1425841
parents 7b2352c7 dcea4a23
...@@ -73,9 +73,6 @@ again: ...@@ -73,9 +73,6 @@ again:
return -1; return -1;
} }
if (ret < 0)
return -1;
TRACE("Received state %s from state client %d", TRACE("Received state %s from state client %d",
lxc_state2str(msg.value), state_client_fd); lxc_state2str(msg.value), state_client_fd);
......
...@@ -2076,8 +2076,6 @@ static int do_includedir(const char *dirp, struct lxc_conf *lxc_conf) ...@@ -2076,8 +2076,6 @@ static int do_includedir(const char *dirp, struct lxc_conf *lxc_conf)
while ((direntp = readdir(dir))) { while ((direntp = readdir(dir))) {
const char *fnam; const char *fnam;
if (!direntp)
break;
fnam = direntp->d_name; fnam = direntp->d_name;
if (!strcmp(fnam, ".")) if (!strcmp(fnam, "."))
......
...@@ -2777,9 +2777,6 @@ static bool has_snapshots(struct lxc_container *c) ...@@ -2777,9 +2777,6 @@ static bool has_snapshots(struct lxc_container *c)
if (!dir) if (!dir)
return false; return false;
while ((direntp = readdir(dir))) { while ((direntp = readdir(dir))) {
if (!direntp)
break;
if (!strcmp(direntp->d_name, ".")) if (!strcmp(direntp->d_name, "."))
continue; continue;
...@@ -4119,9 +4116,6 @@ static int do_lxcapi_snapshot_list(struct lxc_container *c, struct lxc_snapshot ...@@ -4119,9 +4116,6 @@ static int do_lxcapi_snapshot_list(struct lxc_container *c, struct lxc_snapshot
} }
while ((direntp = readdir(dir))) { while ((direntp = readdir(dir))) {
if (!direntp)
break;
if (!strcmp(direntp->d_name, ".")) if (!strcmp(direntp->d_name, "."))
continue; continue;
...@@ -4907,9 +4901,6 @@ int list_defined_containers(const char *lxcpath, char ***names, struct lxc_conta ...@@ -4907,9 +4901,6 @@ int list_defined_containers(const char *lxcpath, char ***names, struct lxc_conta
*names = NULL; *names = NULL;
while ((direntp = readdir(dir))) { while ((direntp = readdir(dir))) {
if (!direntp)
break;
/* Ignore '.', '..' and any hidden directory. */ /* Ignore '.', '..' and any hidden directory. */
if (!strncmp(direntp->d_name, ".", 1)) if (!strncmp(direntp->d_name, ".", 1))
continue; continue;
......
...@@ -85,9 +85,6 @@ static int _recursive_rmdir(const char *dirname, dev_t pdev, ...@@ -85,9 +85,6 @@ static int _recursive_rmdir(const char *dirname, dev_t pdev,
struct stat mystat; struct stat mystat;
int rc; int rc;
if (!direntp)
break;
if (!strcmp(direntp->d_name, ".") || if (!strcmp(direntp->d_name, ".") ||
!strcmp(direntp->d_name, "..")) !strcmp(direntp->d_name, ".."))
continue; continue;
...@@ -2091,9 +2088,6 @@ static int lxc_get_unused_loop_dev_legacy(char *loop_name) ...@@ -2091,9 +2088,6 @@ static int lxc_get_unused_loop_dev_legacy(char *loop_name)
return -1; return -1;
while ((dp = readdir(dir))) { while ((dp = readdir(dir))) {
if (!dp)
break;
if (strncmp(dp->d_name, "loop", 4) != 0) if (strncmp(dp->d_name, "loop", 4) != 0)
continue; continue;
......
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