mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
build: silence false positive clang report
clang complained that STREQ(group->controllers[i].mountPoint,...) was a NULL dereference when i==VIR_CGROUP_CONTROLLER_CPUSET, because it assumes the worst about virCgroupPathOfController. Marking the argument const doesn't yet have an effect, per this clang bug: http://llvm.org/bugs/show_bug.cgi?id=7758 So, we use sa_assert, which was designed to shut up false positives from tools like clang. * src/util/cgroup.c (virCgroupMakeGroup): Teach clang that there is no NULL dereference.
This commit is contained in:
parent
e046d41f72
commit
bd6ea30384
@ -505,6 +505,9 @@ static int virCgroupMakeGroup(virCgroupPtr parent, virCgroupPtr group,
|
||||
rc = virCgroupPathOfController(group, i, "", &path);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
/* As of Feb 2011, clang can't see that the above function
|
||||
* call did not modify group. */
|
||||
sa_assert(group->controllers[i].mountPoint);
|
||||
|
||||
VIR_DEBUG("Make controller %s", path);
|
||||
if (access(path, F_OK) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user