diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-15 16:47:01 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-19 08:10:29 +0900 |
commit | 80a226b26b5e00a2ef9e85d1321da44cd14d051b (patch) | |
tree | 646e2bbb1a80fae9224dc3b3acba2b48668db705 /src/shutdown | |
parent | 03677889f0ef42cdc534bf3b31265a054b20a354 (diff) | |
download | systemd-80a226b26b5e00a2ef9e85d1321da44cd14d051b.tar.gz |
list: make LIST_FOREACH() and LIST_FOREACH_BACKWARDS() safer
Diffstat (limited to 'src/shutdown')
-rw-r--r-- | src/shutdown/umount.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c index 4f14dfb3df..3e9e241499 100644 --- a/src/shutdown/umount.c +++ b/src/shutdown/umount.c @@ -639,7 +639,7 @@ static int swap_points_list_off(MountPoint **head, bool *changed) { assert(head); assert(changed); - LIST_FOREACH_SAFE(mount_point, m, n, *head) { + LIST_FOREACH(mount_point, m, *head) { log_info("Deactivating swap %s.", m->path); if (swapoff(m->path) < 0) { log_warning_errno(errno, "Could not deactivate swap %s: %m", m->path); @@ -663,7 +663,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed, int umo (void) get_block_device("/", &rootdev); - LIST_FOREACH_SAFE(mount_point, m, n, *head) { + LIST_FOREACH(mount_point, m, *head) { if (major(rootdev) != 0 && rootdev == m->devnum) { n_failed++; continue; @@ -694,7 +694,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed, int umount_lo (void) get_block_device("/", &rootdev); - LIST_FOREACH_SAFE(mount_point, m, n, *head) { + LIST_FOREACH(mount_point, m, *head) { if (major(rootdev) != 0 && rootdev == m->devnum) { n_failed ++; continue; @@ -724,7 +724,7 @@ static int md_points_list_detach(MountPoint **head, bool *changed, int umount_lo (void) get_block_device("/", &rootdev); - LIST_FOREACH_SAFE(mount_point, m, n, *head) { + LIST_FOREACH(mount_point, m, *head) { if (major(rootdev) != 0 && rootdev == m->devnum) { n_failed ++; continue; |