Refactor: drop do_ prefix from iterate_proc() and switch_root()

The do_ prefix is conventionally reserved for local helper functions.
Move switch_root() declaration to private.h alongside iterate_proc()
and remove the now-empty initramfs.h header.
This commit is contained in:
Aaron Andersen committed 2026-01-02 18:13:00 -05:00
1 parent 373738f3d1
commit 8e7d1b7bb5
6 files changed
+13 -50

No files matched your search

+4 -4
View File
@@ -208,7 +208,7 @@ static void fs_swapoff(void)
*
* https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
*/
void do_iterate_proc(int (*cb)(int, void *), void *data)
void iterate_proc(int (*cb)(int, void *), void *data)
{
DIR *dirp;
@@ -290,7 +290,7 @@ static int do_wait(int secs)
;
has_proc = 0;
iterations--;
do_iterate_proc(status_cb, &has_proc);
iterate_proc(status_cb, &has_proc);
}
while (has_proc && iterations > 0);
@@ -322,10 +322,10 @@ void do_shutdown(shutop_t op)
* Tell remaining non-monitored processes to exit, give them
* time to exit gracefully, 2 sec was customary, we go for 1.
*/
do_iterate_proc(kill_cb, &signo);
iterate_proc(kill_cb, &signo);
if (do_wait(1)) {
signo = SIGKILL;
do_iterate_proc(kill_cb, &signo);
iterate_proc(kill_cb, &signo);
}
/* Exit plugins gracefully */