From 61cb6ab6b97b0d1ce826d058bdc91b2877315b3e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 29 Dec 2021 13:28:45 -0600 Subject: [PATCH] Move #include into toys.h. --- toys.h | 5 +++-- toys/other/chrt.c | 1 - toys/other/insmod.c | 2 -- toys/other/ionice.c | 1 - toys/other/nsenter.c | 1 - toys/other/pivot_root.c | 3 --- toys/other/readahead.c | 2 -- toys/other/rmmod.c | 1 - toys/other/taskset.c | 1 - toys/other/uclampset.c | 1 - toys/pending/modprobe.c | 1 - toys/pending/strace.c | 1 - 12 files changed, 3 insertions(+), 17 deletions(-) diff --git a/toys.h b/toys.h index 40d8993d..60e22467 100644 --- a/toys.h +++ b/toys.h @@ -56,15 +56,16 @@ #include #include -// Internationalization support (also in POSIX and LSB) +// Internationalization support (also in POSIX) #include #include #include #include -// LSB 4.1 headers +// Non-posix headers #include +#include #include "lib/lib.h" #include "lib/lsm.h" diff --git a/toys/other/chrt.c b/toys/other/chrt.c index 6732a711..11b4f332 100644 --- a/toys/other/chrt.c +++ b/toys/other/chrt.c @@ -35,7 +35,6 @@ GLOBALS( // musl-libc intentionally broke sched_get_priority_min() and friends in // commit 1e21e78bf7a5 because its maintainer didn't like those Linux // system calls, so work around it here. -#include #define sched_get_priority_min(policy) \ (int)syscall(SYS_sched_get_priority_min, (int)policy) #define sched_get_priority_max(policy) \ diff --git a/toys/other/insmod.c b/toys/other/insmod.c index a052f5a0..176e5a6d 100644 --- a/toys/other/insmod.c +++ b/toys/other/insmod.c @@ -15,8 +15,6 @@ config INSMOD #include "toys.h" -#include - void insmod_main(void) { int fd = xopenro(*toys.optargs); diff --git a/toys/other/ionice.c b/toys/other/ionice.c index f356c5fe..d313930e 100644 --- a/toys/other/ionice.c +++ b/toys/other/ionice.c @@ -37,7 +37,6 @@ config IORENICE #define FOR_ionice #include "toys.h" -#include GLOBALS( long p, n, c; diff --git a/toys/other/nsenter.c b/toys/other/nsenter.c index 65469356..78b7598f 100644 --- a/toys/other/nsenter.c +++ b/toys/other/nsenter.c @@ -64,7 +64,6 @@ config NSENTER #define FOR_nsenter #include "toys.h" -#include #include #define unshare(flags) syscall(SYS_unshare, flags) diff --git a/toys/other/pivot_root.c b/toys/other/pivot_root.c index 7748032b..f9a89189 100644 --- a/toys/other/pivot_root.c +++ b/toys/other/pivot_root.c @@ -22,9 +22,6 @@ config PIVOT_ROOT #define FOR_pivot_root #include "toys.h" -#include -#include - void pivot_root_main(void) { if (syscall(__NR_pivot_root, toys.optargs[0], toys.optargs[1])) diff --git a/toys/other/readahead.c b/toys/other/readahead.c index 4edd6516..3221227a 100644 --- a/toys/other/readahead.c +++ b/toys/other/readahead.c @@ -17,8 +17,6 @@ config READAHEAD #include "toys.h" -#include - static void do_readahead(int fd, char *name) { int rc; diff --git a/toys/other/rmmod.c b/toys/other/rmmod.c index b1fd2057..0450c0bc 100644 --- a/toys/other/rmmod.c +++ b/toys/other/rmmod.c @@ -19,7 +19,6 @@ config RMMOD #define FOR_rmmod #include "toys.h" -#include #define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags) void rmmod_main(void) diff --git a/toys/other/taskset.c b/toys/other/taskset.c index 6a9de77f..2a9ae029 100644 --- a/toys/other/taskset.c +++ b/toys/other/taskset.c @@ -34,7 +34,6 @@ config TASKSET #define FOR_taskset #include "toys.h" -#include #define sched_setaffinity(pid, size, cpuset) \ syscall(__NR_sched_setaffinity, (pid_t)pid, (size_t)size, (void *)cpuset) #define sched_getaffinity(pid, size, cpuset) \ diff --git a/toys/other/uclampset.c b/toys/other/uclampset.c index bc3688ee..acf50bda 100644 --- a/toys/other/uclampset.c +++ b/toys/other/uclampset.c @@ -30,7 +30,6 @@ GLOBALS( ) // Added to 5.3 kernel (commit a509a7cd7974): too new to rely on headers -#include #ifndef SCHED_FLAG_RESET_ON_FORK #define SCHED_FLAG_RESET_ON_FORK 0x01 #define SCHED_FLAG_KEEP_POLICY 0x08 diff --git a/toys/pending/modprobe.c b/toys/pending/modprobe.c index fcd1cc3e..45f8ea21 100644 --- a/toys/pending/modprobe.c +++ b/toys/pending/modprobe.c @@ -27,7 +27,6 @@ config MODPROBE */ #define FOR_modprobe #include "toys.h" -#include GLOBALS( struct arg_list *dirs; diff --git a/toys/pending/strace.c b/toys/pending/strace.c index a44dbdfa..ae8fca9f 100644 --- a/toys/pending/strace.c +++ b/toys/pending/strace.c @@ -19,7 +19,6 @@ config STRACE */ #include -#include #include #define FOR_strace -- 2.39.2