maximilian attems
2010-Nov-20 22:31 UTC
[klibc] [PATCH 1/4] utils: cleanup unused includes
several errno.h for no good reasons. cleanup losesetup which is not using getopt_long, thus doesn't need getopt.h included. Move stdarg.h include up in losesetup to more proper place. Signed-off-by: maximilian attems <max at stro.at> --- usr/utils/dmesg.c | 1 - usr/utils/losetup.c | 4 +--- usr/utils/mkfifo.c | 1 - usr/utils/nuke.c | 1 - usr/utils/umount.c | 1 - 5 files changed, 1 insertions(+), 7 deletions(-) diff --git a/usr/utils/dmesg.c b/usr/utils/dmesg.c index 61e047e..1960713 100644 --- a/usr/utils/dmesg.c +++ b/usr/utils/dmesg.c @@ -1,5 +1,4 @@ #include <unistd.h> -#include <errno.h> #include <stdio.h> #include <ctype.h> #include <stdlib.h> diff --git a/usr/utils/losetup.c b/usr/utils/losetup.c index 1a47fa9..59030d7 100644 --- a/usr/utils/losetup.c +++ b/usr/utils/losetup.c @@ -17,6 +17,7 @@ #include <sys/stat.h> #include <sys/mman.h> #include <sys/sysmacros.h> +#include <stdarg.h> #include <string.h> #include "loop.h" @@ -349,9 +350,6 @@ int del_loop (const char *device) } -#include <getopt.h> -#include <stdarg.h> - int verbose = 0; char *progname; diff --git a/usr/utils/mkfifo.c b/usr/utils/mkfifo.c index f2ac35f..5a758b2 100644 --- a/usr/utils/mkfifo.c +++ b/usr/utils/mkfifo.c @@ -1,6 +1,5 @@ #include <sys/stat.h> #include <sys/types.h> -#include <errno.h> #include <fcntl.h> #include <signal.h> #include <stdio.h> diff --git a/usr/utils/nuke.c b/usr/utils/nuke.c index 0a282c8..93a04af 100644 --- a/usr/utils/nuke.c +++ b/usr/utils/nuke.c @@ -32,7 +32,6 @@ * do anything. */ -#include <alloca.h> #include <assert.h> #include <dirent.h> #include <errno.h> diff --git a/usr/utils/umount.c b/usr/utils/umount.c index 4469297..41275f7 100644 --- a/usr/utils/umount.c +++ b/usr/utils/umount.c @@ -2,7 +2,6 @@ * by rmk */ #include <sys/mount.h> -#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -- 1.7.2.3
maximilian attems
2010-Nov-20 22:31 UTC
[klibc] [PATCH 2/4] kinit: cleanup unused includes
Found some unused ctype.h, alloca.h and errno.h. Signed-off-by: maximilian attems <max at stro.at> --- usr/kinit/do_mounts.c | 2 -- usr/kinit/do_mounts_md.c | 1 - usr/kinit/fstype/main.c | 1 - usr/kinit/ipconfig/main.c | 1 - usr/kinit/name_to_dev.c | 1 - usr/kinit/nfsmount/sunrpc.c | 1 - usr/kinit/ramdisk_load.c | 1 - usr/kinit/resume/resumelib.c | 1 - usr/kinit/run-init/runinitlib.c | 1 - 9 files changed, 0 insertions(+), 10 deletions(-) diff --git a/usr/kinit/do_mounts.c b/usr/kinit/do_mounts.c index 0c5ef42..6384042 100644 --- a/usr/kinit/do_mounts.c +++ b/usr/kinit/do_mounts.c @@ -1,4 +1,3 @@ -#include <ctype.h> #include <errno.h> #include <fcntl.h> #include <sys/mount.h> @@ -7,7 +6,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <alloca.h> #include <inttypes.h> #include "do_mounts.h" diff --git a/usr/kinit/do_mounts_md.c b/usr/kinit/do_mounts_md.c index c1c8b01..7c6ed8d 100644 --- a/usr/kinit/do_mounts_md.c +++ b/usr/kinit/do_mounts_md.c @@ -14,7 +14,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <alloca.h> #include <inttypes.h> #include <sys/sysmacros.h> #include <sys/md.h> diff --git a/usr/kinit/fstype/main.c b/usr/kinit/fstype/main.c index 0ceb593..9162bdf 100644 --- a/usr/kinit/fstype/main.c +++ b/usr/kinit/fstype/main.c @@ -16,7 +16,6 @@ #include <fcntl.h> #include <unistd.h> #include <string.h> -#include <errno.h> #include <stdlib.h> #include "fstype.h" diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index d912f6d..095a6f0 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -1,4 +1,3 @@ -#include <errno.h> #include <poll.h> #include <limits.h> #include <setjmp.h> diff --git a/usr/kinit/name_to_dev.c b/usr/kinit/name_to_dev.c index ab19084..d491285 100644 --- a/usr/kinit/name_to_dev.c +++ b/usr/kinit/name_to_dev.c @@ -1,5 +1,4 @@ #include <ctype.h> -#include <errno.h> #include <fcntl.h> #include <sys/stat.h> #include <stdio.h> diff --git a/usr/kinit/nfsmount/sunrpc.c b/usr/kinit/nfsmount/sunrpc.c index 7283519..0628cef 100644 --- a/usr/kinit/nfsmount/sunrpc.c +++ b/usr/kinit/nfsmount/sunrpc.c @@ -1,7 +1,6 @@ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> -#include <errno.h> #include <poll.h> #include <stdio.h> #include <string.h> diff --git a/usr/kinit/ramdisk_load.c b/usr/kinit/ramdisk_load.c index ac2eaac..2b3503a 100644 --- a/usr/kinit/ramdisk_load.c +++ b/usr/kinit/ramdisk_load.c @@ -1,4 +1,3 @@ -#include <ctype.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> diff --git a/usr/kinit/resume/resumelib.c b/usr/kinit/resume/resumelib.c index 32954bb..e557b05 100644 --- a/usr/kinit/resume/resumelib.c +++ b/usr/kinit/resume/resumelib.c @@ -2,7 +2,6 @@ * Handle resume from suspend-to-disk */ -#include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> diff --git a/usr/kinit/run-init/runinitlib.c b/usr/kinit/run-init/runinitlib.c index 3e5627e..8f1562f 100644 --- a/usr/kinit/run-init/runinitlib.c +++ b/usr/kinit/run-init/runinitlib.c @@ -40,7 +40,6 @@ * On failure, returns a human-readable error message. */ -#include <alloca.h> #include <assert.h> #include <dirent.h> #include <errno.h> -- 1.7.2.3
maximilian attems
2010-Nov-20 22:31 UTC
[klibc] [PATCH 3/4] tests: cleanup unused includes
Several unused errno.h and a stdarg.h. Signed-off-by: maximilian attems <max at stro.at> --- usr/klibc/tests/fcntl.c | 1 - usr/klibc/tests/stat.c | 1 - usr/klibc/tests/statfs.c | 1 - usr/klibc/tests/testvsnp.c | 1 - 4 files changed, 0 insertions(+), 4 deletions(-) diff --git a/usr/klibc/tests/fcntl.c b/usr/klibc/tests/fcntl.c index b2bdbdf..219423e 100644 --- a/usr/klibc/tests/fcntl.c +++ b/usr/klibc/tests/fcntl.c @@ -5,7 +5,6 @@ #include <stdio.h> #include <unistd.h> #include <fcntl.h> -#include <errno.h> #include <stdlib.h> #include <string.h> diff --git a/usr/klibc/tests/stat.c b/usr/klibc/tests/stat.c index 90223cf..4410833 100644 --- a/usr/klibc/tests/stat.c +++ b/usr/klibc/tests/stat.c @@ -1,6 +1,5 @@ #include <stdio.h> #include <stdlib.h> -#include <errno.h> #include <sys/stat.h> #include <sys/sysmacros.h> #include <sys/types.h> diff --git a/usr/klibc/tests/statfs.c b/usr/klibc/tests/statfs.c index 0cf99f1..0ac8051 100644 --- a/usr/klibc/tests/statfs.c +++ b/usr/klibc/tests/statfs.c @@ -1,6 +1,5 @@ #include <stdio.h> #include <stdlib.h> -#include <errno.h> #include <sys/vfs.h> static void do_statfs(const char *path) diff --git a/usr/klibc/tests/testvsnp.c b/usr/klibc/tests/testvsnp.c index 098b49a..7120bda 100644 --- a/usr/klibc/tests/testvsnp.c +++ b/usr/klibc/tests/testvsnp.c @@ -1,5 +1,4 @@ #include <assert.h> -#include <stdarg.h> #include <stddef.h> #include <stdint.h> #include <string.h> -- 1.7.2.3
Some stdarg.h, errno.h and sys/ioctl.h for the good mix. Signed-off-by: maximilian attems <max at stro.at> --- usr/klibc/execv.c | 1 - usr/klibc/execvp.c | 1 - usr/klibc/fgetc.c | 1 - usr/klibc/getpt.c | 1 - usr/klibc/posix_openpt.c | 1 - usr/klibc/system.c | 1 - 6 files changed, 0 insertions(+), 6 deletions(-) diff --git a/usr/klibc/execv.c b/usr/klibc/execv.c index 29e5737..6894e79 100644 --- a/usr/klibc/execv.c +++ b/usr/klibc/execv.c @@ -2,7 +2,6 @@ * execv.c */ -#include <stdarg.h> #include <unistd.h> int execv(const char *path, char *const *argv) diff --git a/usr/klibc/execvp.c b/usr/klibc/execvp.c index 5a9f31d..7d8e2bc 100644 --- a/usr/klibc/execvp.c +++ b/usr/klibc/execvp.c @@ -2,7 +2,6 @@ * execvp.c */ -#include <stdarg.h> #include <unistd.h> int execvp(const char *path, char *const *argv) diff --git a/usr/klibc/fgetc.c b/usr/klibc/fgetc.c index 9092eae..5b136b1 100644 --- a/usr/klibc/fgetc.c +++ b/usr/klibc/fgetc.c @@ -9,7 +9,6 @@ #include <stdio.h> #include <unistd.h> #include <stdlib.h> -#include <errno.h> int fgetc(FILE *f) { diff --git a/usr/klibc/getpt.c b/usr/klibc/getpt.c index 76ca371..8d2a536 100644 --- a/usr/klibc/getpt.c +++ b/usr/klibc/getpt.c @@ -9,7 +9,6 @@ #include <unistd.h> #include <termios.h> #include <fcntl.h> -#include <sys/ioctl.h> int getpt(void) { diff --git a/usr/klibc/posix_openpt.c b/usr/klibc/posix_openpt.c index 79e67b6..794ca46 100644 --- a/usr/klibc/posix_openpt.c +++ b/usr/klibc/posix_openpt.c @@ -7,7 +7,6 @@ #include <unistd.h> #include <termios.h> #include <fcntl.h> -#include <sys/ioctl.h> int posix_openpt(int oflag) { diff --git a/usr/klibc/system.c b/usr/klibc/system.c index 4478b21..13e9fbe 100644 --- a/usr/klibc/system.c +++ b/usr/klibc/system.c @@ -7,7 +7,6 @@ * present. */ -#include <errno.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> -- 1.7.2.3
Apparently Analagous Threads
- [PATCH v2 0/4] Support drop directories directly from kinit
- [PATCH] run-init: add drop_capabilities support
- [PATCH 1/3] klibc: Add scandir() and alphasort() support.
- [PATCH 00/16] External building, update for 2.6.33 and multiple root devices.
- [rfc] standalone kinit/resume