mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
llvm-analyze: change a few things to make llvm-analyze show fewer false positives
This commit is contained in:
parent
de3756ab99
commit
3e085b6c59
@ -413,6 +413,7 @@ static int manager_enumerate_users_from_cgroup(Manager *m) {
|
||||
int r = 0;
|
||||
char *name;
|
||||
DIR *d;
|
||||
int k;
|
||||
|
||||
r = cg_enumerate_subgroups(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_path, &d);
|
||||
if (r < 0) {
|
||||
@ -423,9 +424,8 @@ static int manager_enumerate_users_from_cgroup(Manager *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
while ((r = cg_read_subgroup(d, &name)) > 0) {
|
||||
while ((k = cg_read_subgroup(d, &name)) > 0) {
|
||||
User *user;
|
||||
int k;
|
||||
|
||||
k = manager_add_user_by_name(m, name, &user);
|
||||
if (k < 0) {
|
||||
@ -446,6 +446,9 @@ static int manager_enumerate_users_from_cgroup(Manager *m) {
|
||||
free(name);
|
||||
}
|
||||
|
||||
if (r >= 0 && k < 0)
|
||||
r = k;
|
||||
|
||||
closedir(d);
|
||||
|
||||
return r;
|
||||
|
@ -165,6 +165,9 @@ int show_sysfs(const char *seat, const char *prefix, unsigned n_columns) {
|
||||
else
|
||||
r = udev_enumerate_add_match_tag(e, "seat");
|
||||
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
r = udev_enumerate_scan_devices(e);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
@ -2154,8 +2154,6 @@ static void print_status_info(UnitStatusInfo *i) {
|
||||
|
||||
printf(")%s\n", off);
|
||||
|
||||
on = off = NULL;
|
||||
|
||||
if (i->main_pid == p->pid &&
|
||||
i->start_timestamp == p->start_timestamp &&
|
||||
i->exit_timestamp == p->start_timestamp)
|
||||
|
@ -565,10 +565,13 @@ int umount_all(bool *changed) {
|
||||
/* retry umount, until nothing can be umounted anymore */
|
||||
do {
|
||||
umount_changed = false;
|
||||
r = mount_points_list_umount(&mp_list_head, &umount_changed, false);
|
||||
|
||||
mount_points_list_umount(&mp_list_head, &umount_changed, false);
|
||||
if (umount_changed)
|
||||
*changed = true;
|
||||
} while(umount_changed);
|
||||
|
||||
} while (umount_changed);
|
||||
|
||||
/* umount one more time with logging enabled */
|
||||
r = mount_points_list_umount(&mp_list_head, &umount_changed, true);
|
||||
if (r <= 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user