X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Funame.c;h=2eecb5d6d1b40b4d0c038b6ebb0294a0c1800fda;hb=be039374f3bd1c76535387ac4d079506804be270;hp=d4188cdae6ab0d199c87eeb81865f2aa0e90ea69;hpb=b6adbf1be29841501cc49917249e85f273e1df7c;p=oweals%2Fbusybox.git diff --git a/coreutils/uname.c b/coreutils/uname.c index d4188cdae..2eecb5d6d 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -30,12 +30,6 @@ * Now does proper error checking on i/o. Plus some further space savings. */ -#include -#include -#include -#include -#include -#include #include #include "libbb.h" @@ -44,8 +38,8 @@ typedef struct { char processor[8]; /* for "unknown" */ } uname_info_t; -static const char options[] = "snrvmpa"; -static const unsigned short int utsname_offset[] = { +static const char options[] ALIGN1 = "snrvmpa"; +static const unsigned short utsname_offset[] ALIGN2 = { offsetof(uname_info_t,name.sysname), offsetof(uname_info_t,name.nodename), offsetof(uname_info_t,name.release), @@ -54,7 +48,7 @@ static const unsigned short int utsname_offset[] = { offsetof(uname_info_t,processor) }; -int uname_main(int argc, char **argv); +int uname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int uname_main(int argc, char **argv) { uname_info_t uname_info; @@ -64,7 +58,7 @@ int uname_main(int argc, char **argv) const unsigned short int *delta; char toprint; - toprint = getopt32(argc, argv, options); + toprint = getopt32(argv, options); if (argc != optind) { bb_show_usage(); @@ -97,12 +91,12 @@ int uname_main(int argc, char **argv) if (toprint & 1) { printf(((char *)(&uname_info)) + *delta); if (toprint > 1) { - putchar(' '); + bb_putchar(' '); } } ++delta; } while (toprint >>= 1); - putchar('\n'); + bb_putchar('\n'); fflush_stdout_and_exit(EXIT_SUCCESS); }