From 2c82ebc6d248419acb7af89b0b3f54ad28557b5b Mon Sep 17 00:00:00 2001 From: liyanshui Date: Thu, 29 Jun 2023 02:03:27 +0000 Subject: [PATCH] The if(*(it + 1)) check will always be true as already verified in for(;it && *it;). Remove it. --- 0034-remove-unnecessary-check.patch | 26 ++++++++++++++++++++++++++ lxc.spec | 1 + 2 files changed, 27 insertions(+) create mode 100644 0034-remove-unnecessary-check.patch diff --git a/0034-remove-unnecessary-check.patch b/0034-remove-unnecessary-check.patch new file mode 100644 index 0000000..0b8681a --- /dev/null +++ b/0034-remove-unnecessary-check.patch @@ -0,0 +1,26 @@ +From 9ed2e5e3c61b2f54a290678e6f09e55595b603e2 Mon Sep 17 00:00:00 2001 +From: liyanshui +Date: Thu, 29 Jun 2023 01:47:09 +0000 +Subject: [PATCH] The if(*(it + 1)) check will always be true as + already verified in for(;it && *it;). Remove it. + +--- + src/lxc/cgroups/isulad_cgfsng.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lxc/cgroups/isulad_cgfsng.c b/src/lxc/cgroups/isulad_cgfsng.c +index dcaa229..fbfda97 100644 +--- a/src/lxc/cgroups/isulad_cgfsng.c ++++ b/src/lxc/cgroups/isulad_cgfsng.c +@@ -2782,7 +2782,7 @@ bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cgroup) + (void)strlcat(add_controllers, "+", full_len + 1); + (void)strlcat(add_controllers, *it, full_len + 1); + +- if ((it + 1) && *(it + 1)) ++ if (*(it + 1)) + (void)strlcat(add_controllers, " ", full_len + 1); + } + +-- +2.30.0 + diff --git a/lxc.spec b/lxc.spec index 44ead75..33b3969 100644 --- a/lxc.spec +++ b/lxc.spec @@ -41,6 +41,7 @@ Patch0030: 0030-remove-unused-meminfo-stats.patch Patch0031: 0031-lxc-attach-Fix-lost-return-codes-of-spawned-processe.patch Patch0032: 0032-fix-load-bpf-failed.patch Patch0033: 0033-fix-mount-device-path-incorrect.patch +Patch0034: 0034-remove-unnecessary-check.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) -- Gitee