libcgroup/libcgroup-0.40.rc1-templates-fix.patch
leizhongkai 4a718e1133 libcgroup: new upstream release 0.42.2
fix !I1RU2L

The upstream is migrated from "sourceforge" to "github",
we need to upgrade accordingly.

Signed-off-by: leizhongkai <leizhongkai@huawei.com>
2020-11-04 14:41:23 +08:00

18 lines
561 B
Diff

diff --git libcgroup-0.42.2/src/api.c libcgroup-0.42.2/src/api.c
index 1557393..318a438 100644
--- libcgroup-0.42.2/src/api.c
+++ libcgroup-0.42.2/src/api.c
@@ -3457,10 +3457,10 @@ int cgroup_change_cgroup_flags(uid_t uid, gid_t gid,
available, "%d", pid);
break;
case 'p':
- if(procname) {
+ if(procname && strlen(basename(procname))) {
written = snprintf(newdest + j,
available, "%s",
- procname);
+ basename(procname));
} else {
written = snprintf(newdest + j,
available, "%d", pid);